Skip to content

contract(qwen3-moe-forward-v1): v1.2.0 → v1.3.0 — M32d.0 parity strategy decision#1128

Merged
noahgift merged 1 commit into
mainfrom
contract/m32d-parity-strategy
Apr 29, 2026
Merged

contract(qwen3-moe-forward-v1): v1.2.0 → v1.3.0 — M32d.0 parity strategy decision#1128
noahgift merged 1 commit into
mainfrom
contract/m32d-parity-strategy

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Summary

Records the M32d parity strategy decision in qwen3-moe-forward-v1
amendment history. No code change; contract amendment only.

The original FALSIFY-QW3-MOE-FORWARD-004 referenced
llama-cli ... --verbose --logit-output as the reference path
for full-vector logit dump. That flag does not exist in stock
llama.cpp v7746. M32d cannot proceed without picking an
actually-existing reference path.

Decision

PRIMARY (full-vector cosine > 0.99 per AC_QW3_MOE_005):
HuggingFace transformers FP16 via uv run --with torch --with transformers
running scripts/generate_qwen3_moe_fp16_logits.py. Dumps the
full 151936-dim logit vector at position 0 for prompt
"What is 2+2?" to a JSON fixture.

SECONDARY (top-1 argmax sanity):
llama-cli -m <gguf> -p "..." -n 1 --top-k 1 --temp 0.0 --seed 0
as subprocess; asserts apr's argmax == llama.cpp's top-1 token.

REJECTED: patched llama.cpp full-vector logit dump
(out-of-tree patch maintenance burden too high).

M32d sub-slice plan (each its own PR)

Slice Deliverable
M32d.0 THIS PR — contract amendment
M32d.1 scripts/generate_qwen3_moe_fp16_logits.py + one-time fixture generation on lambda-vector
M32d.2 f_qw3_moe_parity_001_cosine_vs_hf_fp16 test (primary gate)
M32d.3 f_qw3_moe_parity_002_argmax_vs_llama_cpp test (secondary sanity)
M32d.4 Flip contract DRAFT → ACTIVE_RUNTIME (v1.3.0 → v2.0.0); update companion-repo POC spec to record FALSIFY-CCPA-013 unblock

Test plan

  • pv validate contracts/qwen3-moe-forward-v1.yaml — 0 errors, 0 warnings
  • CI ci/gate green

🤖 Generated with Claude Code

…egy decision

## Why

The original FALSIFY-QW3-MOE-FORWARD-004 test description references
`llama-cli ... --verbose --logit-output` as the reference path for
full-vector logit dump. **That flag does not exist** in stock
llama.cpp v7746 (`llama-cli --help` exposes `--logit-bias` but no
logit-output flag).

M32d cannot proceed without picking an actually-existing reference
path. This amendment records the decision so downstream M32d.1-.4
sub-slices have a stable target.

## Decision

PRIMARY (full-vector cosine > 0.99): HF transformers FP16 via uv-run
Python — `uv run --with torch --with transformers
scripts/generate_qwen3_moe_fp16_logits.py`. Dumps the full
151936-dim logit vector at position 0 to a JSON fixture.

SECONDARY (top-1 argmax sanity): llama.cpp via subprocess — runs
`llama-cli -m <gguf> -p ... -n 1 --top-k 1 --temp 0.0 --seed 0`
and parses stdout to extract the single emitted token; asserts
apr's argmax == llama.cpp's top-1.

REJECTED: patched llama.cpp full-vector logit dump (out-of-tree
patch maintenance burden too high for the discharge value).

## What ships

1. `metadata.amendment_history` v1.3.0 entry recording the three
   reference paths considered, the decision, the rationale, and
   the M32d sub-slice plan (.0–.4).

2. Top-level `version` 1.2.0 → 1.3.0; status comment expanded to
   note the v1.3.0 strategy decision and the missing llama-cli flag.

3. `implementation_stages` M32d entry rewritten to enumerate
   M32d.0–M32d.4 sub-slices with concrete deliverables per slice.

4. `falsification_tests` FALSIFY-QW3-MOE-FORWARD-004 rewritten:
   - `prediction:` two-axis (cosine vs HF FP16 + argmax vs llama.cpp)
   - `test:` references new fixture path + subprocess invocation
   - `if_fails:` 3-step diagnostic order keyed off which axis fails

5. `cross_repo_references[paiml/claude-code-parity-apr].current_version`
   bumped 1.19.0 → 1.20.0 (companion repo bumped this morning at
   PR #38 squash 5aff6d5).

## What's NOT in this PR

- The fixture-generation script (M32d.1, next slice).
- The parity tests themselves (M32d.2, M32d.3).
- The DRAFT → ACTIVE_RUNTIME flip (M32d.4).

## Test plan

- [x] `pv validate contracts/qwen3-moe-forward-v1.yaml` — 0 errors, 0 warnings
- [ ] CI ci/gate green
- [ ] Workspace test green

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@noahgift noahgift merged commit 2682132 into main Apr 29, 2026
11 checks passed
@noahgift noahgift deleted the contract/m32d-parity-strategy branch April 29, 2026 09:04
noahgift added a commit that referenced this pull request May 1, 2026
M33 audit-trail bump on companion side. Records:
  * #1127 (M32c.2.2.2.1.4) live regression test on aprender main
  * #1128 #1129 #1130 #1131 (M32d.0/.1/.2/.3) parity scaffolding

No code change beyond this contract mirror. M22 4-step ritual:
mirror push (this commit) → companion pin.lock refresh → companion
spec PR. Contract sha256
f4ea18b1acaea56ef8ef40fc857e5057e06e0627232be5b248dad6389b68e846
byte-identical with companion side.

Refs: claude-code-parity-apr-v1 § companion_repo.contract_pin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant