contract(apr-cli-trace-save-tensor-v1): v1.2.0 → v1.3.0 — FALSIFY-011 records CLI dispatch wire-up PARTIAL discharge#1418
Merged
noahgift merged 1 commit intoMay 3, 2026
Conversation
3269cf6 to
2f138d0
Compare
5 tasks
noahgift
added a commit
that referenced
this pull request
May 3, 2026
… 7B teacher (#1419) End-to-end live smoke of `apr trace --save-tensor` against the canonical Qwen2.5-Coder-7B-Instruct-Q4K teacher on RTX 4090 (lambda-labs). Outcome: APRT byte format produced verbatim for `embedding,lm_head` stages. - `layer-0/embedding.bin`: 100,364 bytes = 12-byte header + (7×3584)×4 - `lm_head.bin`: 608,268 bytes = 12-byte header + 152,064×4 xxd-confirmed APRT magic + correct layer/dim header fields. Forward pass succeeded — 28 layer activations + 152,064 logits — same as `apr run`. Discharges three FALSIFY-APR-TRACE-SAVE-* gates from PARTIAL_ALGORITHM_LEVEL to FUNCTIONAL_DISCHARGED level (009/010/011). Contract v1.4.0 bump follows once #1418 v1.3.0 paperwork lands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
… records CLI dispatch wire-up PARTIAL discharge Follow-up paperwork to PR #1417 (`apr trace --save-tensor` end-to-end dispatch for .apr files). Adds FALSIFY-APR-TRACE-SAVE-011 binding the new dispatch wire-up at PARTIAL_ALGORITHM_LEVEL with `binds_to: cli_signature`. Before PR #1417, `apr trace --save-tensor` only printed a stub and never invoked `forward_traced_with_save_tensor`. The contract test `apr trace --save-tensor --help | grep save-tensor` (FALSIFY-001) was already passing at the binary-boundary level — but the dispatch glue was missing, leaving Embedding + LmHead capture surface unreachable from the CLI for 2 days post-step-2 merge. FALSIFY-011 extends the existing `cli_signature` invariant from "the flag is recognized" to "the flag actually produces files". ## Five Whys 1. **Why a separate contract bump?** Avoids file-conflict with the in-flight refactor PR #1416 (which only touches `crates/aprender-serve/`). My contract change is isolated to `contracts/apr-cli-trace-save-tensor-v1.yaml`. 2. **Why `binds_to: cli_signature`?** PR #1417 doesn't change the byte format or determinism — it makes the CLI surface that the `cli_signature` equation already specified actually invocable. Same equation, expanded discharge level. 3. **Why PARTIAL_ALGORITHM_LEVEL?** The 5 unit tests cover path resolution (3) and recursive *.bin walking (2) — algorithm-level. A live discharge against the canonical 7B teacher is operator- gated by post-merge smoke (~30s for a 7B forward + 2 file writes). 4. **Why bump v1.2.0 → v1.3.0?** Adding a new falsification test that binds an existing invariant is a minor schema change per semver. v1.0.0 → v1.1.0 → v1.2.0 → v1.3.0 records each step's discharge timeline: - v1.1.0 (PR #1413): apr_diff_values_compat → APRT-aware diff - v1.2.0 (PR #1415): byte_format → LmHead capture (step 2) - v1.3.0 (this PR): cli_signature → end-to-end dispatch 5. **Why now?** Records the algorithm-level discharge so when the operator runs the live smoke post-#1417-merge, the contract ledger doesn't lag the code. Same paperwork pattern as #1415 (which followed #1414). ## Verification - `pv validate contracts/apr-cli-trace-save-tensor-v1.yaml` → 0 errors, 0 warnings ## Ship % update - MODEL-1: ~70% (unchanged — pure paperwork; code is in PR #1417). - MODEL-2: corpus tokenization at ~115M tokens / 143 min (steady ~14K tok/s; ~33h ETA total). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2f138d0 to
1d13658
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contracts/apr-cli-trace-save-tensor-v1.yamlfrom v1.2.0 → v1.3.0apr trace --save-tensordispatch wire-up — PARTIAL_ALGORITHM_LEVELbinds_to: cli_signature(the contract's existingcli_signature:block)algorithm_evidencecites the 5 unit tests landed in PR feat(apr-cli): wire apr trace --save-tensor end-to-end for .apr files #1417 (CLI dispatch)pv validatereturned 0 errors / 0 warnings before commitWhy
PR #1417 wires the merged
apr trace --save-tensorclap surface (PR #1405) + plan-builder (PR #1406) + APR forward wrapper (PRs #1408, #1414) through the dispatch layer, soapr trace --save-tensor model.aprnow actually invokesforward_traced_with_save_tensorand writes APRT files to disk. Without the contract update the dispatch wire-up has no provable-contracts trace.Five Whys
binds_to: cli_signature? The new dispatch path is the bridge between the existingcli_signatureclap block and the existingapr_forward_wrapperimpl block —cli_signatureis the most-upstream binding point.Test plan
pv validate contracts/apr-cli-trace-save-tensor-v1.yaml— 0 errors / 0 warnings🤖 Generated with Claude Code