Astrea
Agent-native calibration harness for hipfire quant candidates. The executable
is python3 scripts/astrea.py. It emits JSON plan/policy/metrics artifacts;
you supply experiment judgment and promotion discipline.
Mutable format math, operator quantize flags, KV defaults, and validation
routes live in canonical owners — link them; do not copy inventories here.
Reach for this when
- Calibrating or comparing weight formats (MQ / HFQ / HFP / MFP / Q8 / F16 / Paro)
- Joining GGUF imatrix coverage to HFQ tensor names
- Building mixed-format promotion policies under a size budget
- Planning KV-cache policy profiles for Atlas join
- Importing/oracling ParoQuant (
PARO4G128) checkpoints
- Deciding promote / reject / iterate from measured KLD/PPL + runtime evidence
Canonical owners (read these; do not fork)
Executable truth for CLI flags: python3 scripts/astrea.py <cmd> --help.
Core rules
- No quality claim without measured KLD/PPL (or an explicit blocked eval
path). Dry-run Astrea JSON is a plan, not calibrated weights.
- No ship-ready claim without runtime compatibility + perf evidence on
the formats the candidate actually uses. Prefer Atlas AR and, when the
path is DFlash-relevant, DFlash rows — via the Atlas skill/methodology.
bundle-plan is a package contract artifact, not a model writer. Do
not claim Astrea packaged a loadable model unless a real writer path ran
(promote, calibrate --write-candidate, or paro-import).
- Do not invent gates. Pick routes from
docs/VALIDATION.md. There is
no universal GPU/coherence replacement gate. Retired
scripts/coherence-gate-*.sh batteries are historical reproduction only.
- Do not compare KLD/PPL across different engine fingerprints or RoPE
conventions without marking the comparison historical.
- Non-finite logits fail the candidate. Reject
KLD=0 rows unless the
logit path is confirmed finite.
- Admissions stay machine-recorded only in
docs/admissions.yml. A green
eval or bench does not create an admission.
CLI surface
Run from the hipfire repo root. Prefer --pretty for humans; --out PATH
writes JSON and silences stdout.
python3 scripts/astrea.py inspect --model MODEL [--imatrix IMATRIX] [--format FORMAT]
python3 scripts/astrea.py imatrix-join --model MODEL --imatrix IMATRIX [--max-tensors N]
python3 scripts/astrea.py fingerprint [--engine-root REPO]
python3 scripts/astrea.py plan --model MODEL --format FORMAT --method METHOD \
[--recipe-stage STAGE:METHOD] [--imatrix IMATRIX] [--source-dir BF16_DIR] \
[--eval-command CMD] [--atlas-command CMD]
python3 scripts/astrea.py calibrate --plan PLAN.json [--source-dir BF16_DIR] \
[--write-candidate] [--max-tensors N] [--tensor-filter NAME] [--workers N] [--dry-run]
python3 scripts/astrea.py eval --plan PLAN.json [--run]
python3 scripts/astrea.py metrics --quality-json result-data.json \
--candidate-variant NAME [--baseline-variant NAME] [--floor-variant NAME] \
[--arch ARCH] [--scoring-mode MODE] [--engine-root REPO]
python3 scripts/astrea.py policy --model MODEL --base-format FMT --promotion-format FMT \
(--sensitivity-json SCORES.json | --imatrix IMATRIX) --max-extra-bytes N \
[--method METHOD] [--objective OBJ] [--domain weights|kv] [--model-family FAMILY]
python3 scripts/astrea.py promote --policy POLICY.json --source-dir BF16_DIR --output CANDIDATE.hfq \
[--max-tensors N] [--tensor-filter NAME]
python3 scripts/astrea.py kv-profile --model MODEL [--mode MODE] [--triattn PATH] \
[--model-family FAMILY] [--engine-root REPO]
python3 scripts/astrea.py bundle-plan --model MODEL --output MODEL.hfq \
[--include weights|paro|kv-policy|triattn|evidence] [--triattn PATH] [--policy-id ID]
python3 scripts/astrea.py paro-probe --model MODEL [--local-only] [--max-modules N]
python3 scripts/astrea.py paro-import --model MODEL --output OUT.hfq \
[--layout native|engine] [--copy-floats f16|q8] [--local-only]
python3 scripts/astrea.py paro-oracle --source PARO_SAFE_DIR --hfq MODEL.hfq \
[--module MODULE] [--samples N] [--atol TOL]
python3 scripts/astrea.py report ARTIFACT.json ...
Supported format/method/KV-mode tokens are defined in scripts/astrea.py
(SUPPORTED_FORMATS, SUPPORTED_METHODS, SUPPORTED_KV_MODES, …). Query the
script or --help rather than trusting a skill-local table.
Workflow
- Scope — model path, target format(s), BF16/higher-precision reference,
eval corpus, size budget, and whether the change is weights, KV, or both.
inspect / imatrix-join — fingerprint inputs; confirm imatrix↔HFQ
coverage before planning mutation.
fingerprint — capture engine git/source hashes and RoPE path
(halfsplit / interleaved_legacy / unknown). Pass --engine-root when
the evaluated binary is not this checkout.
plan — bounded experiment artifact. Methods stack as recipe stages
(--method repeated; optional --recipe-stage stage:method). Attach
--eval-command and --atlas-command so later steps are reproducible.
calibrate — without --write-candidate, reports join readiness only.
With --write-candidate, may rewrite same-size tensor ranges for supported
recipes (e.g. MFP4 imatrix-scale, MQ4 AWQ-style clipping, MQ4 LS when
methods match). Use --max-tensors / --tensor-filter for smokes;
--workers N for large rewrites. Treat unimplemented mutation paths as
blocked, not as silent success.
eval then metrics — run KLD/PPL against a fixed reference; ingest
kld_reduce.py result-data.json (or equivalent). Prefer a Q8 / accepted
high-precision floor row so above-floor KLD and recovered damage % are
meaningful. Attach exact command, reference, dataset/chunk count, and
artifact identity to every quality claim.
policy / promote — optional mixed-format promotion under
--max-extra-bytes. Objectives include dynamic-tensor-policy,
moe-probe, model-ingress, kv-policy. Policy is a selector, not quality
evidence — re-run metrics after every written candidate. Today promote
writes selected q8 promotions as runtime-compatible Q8F16 records and
rebuilds the HFQ index/data payload.
kv-profile — when KV behavior changes or a model should carry an
embedded KV policy. Include a live baseline mode and each candidate mode
under investigation. Output is a policy/evidence shape for Atlas join, not
proof that kernels/loader implement the mode.
- Paro lane —
paro-probe → paro-import (writes loadable PARO4G128)
→ paro-oracle against the PyTorch source before quality or perf claims.
See docs/QUANTIZATION.md Paro payload contract.
bundle-plan — future single-file package shape (weights, paro, kv-policy,
triattn, evidence). Deferred loader/daemon work stays deferred until source
implements it.
- Atlas perf — if quality improves and the candidate touches runtime
formats on AR and/or DFlash paths, collect phase-aware rows per
.agents/skills/hipfire-kernel-atlas/ and
docs/methodology/kernel-atlas.md. Follow
docs/methodology/perf-benchmarking.md for fresh-process / noise rules.
report — summarize artifacts; recommend promote, reject, or iterate.
Promotion into product defaults still requires an admissions row when that
registry defines one — currently fail closed on empty records.
Experiment guidance (non-inventory)
- Start high-signal paths (e.g.
mfp4 + imatrix-scale, or MQ4 activation-aware
recipes) and compare stacks empirically — do not treat a single past run
as a permanent win.
- ParoQuant remains a first-class transform lane: probe/import/oracle are
executable; fused runtime inverse + matvec still need producer-consumer proof
before ship language.
- MoE policies must separate router, expert, and shared dense tensors; expert
promotion needs hit-distribution + quality deltas, not name lists alone.
- KV: product defaults and mode math live in
docs/QUANTIZATION.md /
docs/CONFIG.md / docs/env-vars.md. Astrea kv-profile modes are policy
candidates; research modes stay research until kernels, loader metadata, and
measured AR/DFlash quality exist.
- Preserve HFP/MFP (and any other) producer-consumer contracts: block-size and
runtime requirements move only with quantizer + loader + kernels + docs
together.
Guardrails
- Attach engine fingerprint + eval identity to every quality artifact.
- Atlas / speed-gate / harness green ≠ admission and ≠ universal correctness.
- Path-specific numerical/state parity uses arch-owned oracles when they exist;
serve harnesses cover user-facing semantics only (
docs/VALIDATION.md).
- Historical benchmark tables and campaign checkpoints stay historical.
- No C/A attestation from this skill.
Related skills
1---2name: astrea3description: Use for hipfire quant calibration, imatrix-driven experiments, KLD/PPL quality evaluation, k-map/format selection, MQ/HFQ/HFP/MFP tradeoff work, ParoQuant-style weight transform planning, and KV policy planning. Use when deciding whether a calibrated model candidate should be promoted, rejected, packaged, or sent through Atlas for AR/DFlash perf validation.4---56# Astrea78Agent-native calibration harness for hipfire quant candidates. The executable9is `python3 scripts/astrea.py`. It emits JSON plan/policy/metrics artifacts;10you supply experiment judgment and promotion discipline.1112Mutable format math, operator quantize flags, KV defaults, and validation13routes live in canonical owners — link them; do not copy inventories here.1415## Reach for this when1617- Calibrating or comparing weight formats (MQ / HFQ / HFP / MFP / Q8 / F16 / Paro)18- Joining GGUF imatrix coverage to HFQ tensor names19- Building mixed-format promotion policies under a size budget20- Planning KV-cache policy profiles for Atlas join21- Importing/oracling ParoQuant (`PARO4G128`) checkpoints22- Deciding promote / reject / iterate from measured KLD/PPL + runtime evidence2324## Canonical owners (read these; do not fork)2526| Concern | Owner |27|---|---|28| Quant design / formats / KV math | [`docs/QUANTIZATION.md`](../../../docs/QUANTIZATION.md) |29| `hipfire quantize` operator surface | [`docs/QUANTIZE.md`](../../../docs/QUANTIZE.md) |30| Validation route selection | [`docs/VALIDATION.md`](../../../docs/VALIDATION.md) |31| Docs ownership / truth states | [`docs/INDEX.md`](../../../docs/INDEX.md) |32| Perf measurement protocol | [`docs/methodology/perf-benchmarking.md`](../../../docs/methodology/perf-benchmarking.md) |33| Kernel Atlas methodology | [`docs/methodology/kernel-atlas.md`](../../../docs/methodology/kernel-atlas.md) |34| Atlas agent workflow | [`.agents/skills/hipfire-kernel-atlas/`](../hipfire-kernel-atlas/SKILL.md) |35| Admissions registry | [`docs/admissions.yml`](../../../docs/admissions.yml) (empty = fail closed) |3637Executable truth for CLI flags: `python3 scripts/astrea.py <cmd> --help`.3839## Core rules40411. **No quality claim without measured KLD/PPL** (or an explicit blocked eval42 path). Dry-run Astrea JSON is a plan, not calibrated weights.432. **No ship-ready claim without runtime compatibility + perf evidence** on44 the formats the candidate actually uses. Prefer Atlas AR and, when the45 path is DFlash-relevant, DFlash rows — via the Atlas skill/methodology.463. **`bundle-plan` is a package contract artifact, not a model writer.** Do47 not claim Astrea packaged a loadable model unless a real writer path ran48 (`promote`, `calibrate --write-candidate`, or `paro-import`).494. **Do not invent gates.** Pick routes from `docs/VALIDATION.md`. There is50 no universal GPU/coherence replacement gate. Retired51 `scripts/coherence-gate-*.sh` batteries are historical reproduction only.525. **Do not compare KLD/PPL across different engine fingerprints or RoPE53 conventions** without marking the comparison historical.546. **Non-finite logits fail the candidate.** Reject `KLD=0` rows unless the55 logit path is confirmed finite.567. **Admissions stay machine-recorded only** in `docs/admissions.yml`. A green57 eval or bench does not create an admission.5859## CLI surface6061Run from the hipfire repo root. Prefer `--pretty` for humans; `--out PATH`62writes JSON and silences stdout.6364```bash65python3 scripts/astrea.py inspect --model MODEL [--imatrix IMATRIX] [--format FORMAT]66python3 scripts/astrea.py imatrix-join --model MODEL --imatrix IMATRIX [--max-tensors N]67python3 scripts/astrea.py fingerprint [--engine-root REPO]68python3 scripts/astrea.py plan --model MODEL --format FORMAT --method METHOD \69 [--recipe-stage STAGE:METHOD] [--imatrix IMATRIX] [--source-dir BF16_DIR] \70 [--eval-command CMD] [--atlas-command CMD]71python3 scripts/astrea.py calibrate --plan PLAN.json [--source-dir BF16_DIR] \72 [--write-candidate] [--max-tensors N] [--tensor-filter NAME] [--workers N] [--dry-run]73python3 scripts/astrea.py eval --plan PLAN.json [--run]74python3 scripts/astrea.py metrics --quality-json result-data.json \75 --candidate-variant NAME [--baseline-variant NAME] [--floor-variant NAME] \76 [--arch ARCH] [--scoring-mode MODE] [--engine-root REPO]77python3 scripts/astrea.py policy --model MODEL --base-format FMT --promotion-format FMT \78 (--sensitivity-json SCORES.json | --imatrix IMATRIX) --max-extra-bytes N \79 [--method METHOD] [--objective OBJ] [--domain weights|kv] [--model-family FAMILY]80python3 scripts/astrea.py promote --policy POLICY.json --source-dir BF16_DIR --output CANDIDATE.hfq \81 [--max-tensors N] [--tensor-filter NAME]82python3 scripts/astrea.py kv-profile --model MODEL [--mode MODE] [--triattn PATH] \83 [--model-family FAMILY] [--engine-root REPO]84python3 scripts/astrea.py bundle-plan --model MODEL --output MODEL.hfq \85 [--include weights|paro|kv-policy|triattn|evidence] [--triattn PATH] [--policy-id ID]86python3 scripts/astrea.py paro-probe --model MODEL [--local-only] [--max-modules N]87python3 scripts/astrea.py paro-import --model MODEL --output OUT.hfq \88 [--layout native|engine] [--copy-floats f16|q8] [--local-only]89python3 scripts/astrea.py paro-oracle --source PARO_SAFE_DIR --hfq MODEL.hfq \90 [--module MODULE] [--samples N] [--atol TOL]91python3 scripts/astrea.py report ARTIFACT.json ...92```9394Supported format/method/KV-mode tokens are defined in `scripts/astrea.py`95(`SUPPORTED_FORMATS`, `SUPPORTED_METHODS`, `SUPPORTED_KV_MODES`, …). Query the96script or `--help` rather than trusting a skill-local table.9798## Workflow991001. **Scope** — model path, target format(s), BF16/higher-precision reference,101 eval corpus, size budget, and whether the change is weights, KV, or both.1022. **`inspect` / `imatrix-join`** — fingerprint inputs; confirm imatrix↔HFQ103 coverage before planning mutation.1043. **`fingerprint`** — capture engine git/source hashes and RoPE path105 (`halfsplit` / `interleaved_legacy` / `unknown`). Pass `--engine-root` when106 the evaluated binary is not this checkout.1074. **`plan`** — bounded experiment artifact. Methods stack as recipe stages108 (`--method` repeated; optional `--recipe-stage stage:method`). Attach109 `--eval-command` and `--atlas-command` so later steps are reproducible.1105. **`calibrate`** — without `--write-candidate`, reports join readiness only.111 With `--write-candidate`, may rewrite same-size tensor ranges for supported112 recipes (e.g. MFP4 imatrix-scale, MQ4 AWQ-style clipping, MQ4 LS when113 methods match). Use `--max-tensors` / `--tensor-filter` for smokes;114 `--workers N` for large rewrites. Treat unimplemented mutation paths as115 blocked, not as silent success.1166. **`eval` then `metrics`** — run KLD/PPL against a fixed reference; ingest117 `kld_reduce.py` `result-data.json` (or equivalent). Prefer a Q8 / accepted118 high-precision floor row so above-floor KLD and recovered damage % are119 meaningful. Attach exact command, reference, dataset/chunk count, and120 artifact identity to every quality claim.1217. **`policy` / `promote`** — optional mixed-format promotion under122 `--max-extra-bytes`. Objectives include `dynamic-tensor-policy`,123 `moe-probe`, `model-ingress`, `kv-policy`. Policy is a selector, not quality124 evidence — re-run `metrics` after every written candidate. Today `promote`125 writes selected `q8` promotions as runtime-compatible `Q8F16` records and126 rebuilds the HFQ index/data payload.1278. **`kv-profile`** — when KV behavior changes or a model should carry an128 embedded KV policy. Include a live baseline mode and each candidate mode129 under investigation. Output is a policy/evidence shape for Atlas join, not130 proof that kernels/loader implement the mode.1319. **Paro lane** — `paro-probe` → `paro-import` (writes loadable `PARO4G128`)132 → `paro-oracle` against the PyTorch source before quality or perf claims.133 See `docs/QUANTIZATION.md` Paro payload contract.13410. **`bundle-plan`** — future single-file package shape (weights, paro, kv-policy,135 triattn, evidence). Deferred loader/daemon work stays deferred until source136 implements it.13711. **Atlas perf** — if quality improves and the candidate touches runtime138 formats on AR and/or DFlash paths, collect phase-aware rows per139 `.agents/skills/hipfire-kernel-atlas/` and140 `docs/methodology/kernel-atlas.md`. Follow141 `docs/methodology/perf-benchmarking.md` for fresh-process / noise rules.14212. **`report`** — summarize artifacts; recommend promote, reject, or iterate.143 Promotion into product defaults still requires an admissions row when that144 registry defines one — currently fail closed on empty records.145146## Experiment guidance (non-inventory)147148- Start high-signal paths (e.g. `mfp4` + `imatrix-scale`, or MQ4 activation-aware149 recipes) and **compare stacks empirically** — do not treat a single past run150 as a permanent win.151- ParoQuant remains a first-class transform lane: probe/import/oracle are152 executable; fused runtime inverse + matvec still need producer-consumer proof153 before ship language.154- MoE policies must separate router, expert, and shared dense tensors; expert155 promotion needs hit-distribution + quality deltas, not name lists alone.156- KV: product defaults and mode math live in `docs/QUANTIZATION.md` /157 `docs/CONFIG.md` / `docs/env-vars.md`. Astrea `kv-profile` modes are policy158 candidates; research modes stay research until kernels, loader metadata, and159 measured AR/DFlash quality exist.160- Preserve HFP/MFP (and any other) producer-consumer contracts: block-size and161 runtime requirements move only with quantizer + loader + kernels + docs162 together.163164## Guardrails165166- Attach engine fingerprint + eval identity to every quality artifact.167- Atlas / speed-gate / harness green ≠ admission and ≠ universal correctness.168- Path-specific numerical/state parity uses arch-owned oracles when they exist;169 serve harnesses cover user-facing semantics only (`docs/VALIDATION.md`).170- Historical benchmark tables and campaign checkpoints stay historical.171- No C/A attestation from this skill.172173## Related skills174175- [hipfire-kernel-atlas](../hipfire-kernel-atlas/SKILL.md) — AR/DFlash rows, ISA fit, task/eval loop176- [hipfire-kernel-tuning](../hipfire-kernel-tuning/SKILL.md) — kernel levers after a candidate is quality-clean177- [hipfire-tester](../hipfire-tester/SKILL.md) — hardware bring-up / smoke matrix