Skip to content

fix(T-2): apr finetune --max-seq-len is honoured on the wgpu instruct pipeline or refused with the documented code — never clamped to 512; one effective_max_seq_len() for every path, printed (PMAT-1009, #2924) - #3005

Open
noahgift wants to merge 5 commits into
mainfrom
agent/T-2

Conversation

@noahgift

@noahgift noahgift commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

PP-066 DAG row T-2 (spec §5 "--max-seq-len honoured or refused, never clamped"; S0-11; #2526; epic #2873; ticket PMAT-1009; receipt docs/audits/impl-PMAT-1009-receipt.md, status: partial until merged).

The defect: apr finetune --gpu-backend wgpu --max-seq-len 1024 silently trained at 512 — the wgpu instruct pipeline hardcoded 512, // max_seq_len (finetune.rs:717) and dropped the CLI value; the instruct path honoured it since #2247, so a training receipt could record a configuration the engine never ran (T-0's apr arm cannot be paired until every path is honest).

What lands: one effective_max_seq_len(requested, path) -> Result<usize> for SeqLenPath::{Instruct, Wgpu, Classify}Some(n) is Ok(n) or ValidationFailed (exit 5, read from error.rs), None is the path's default; the 512 literal is gone; every path prints Max seq len: <effective>. Case table finetune_seq_len_truth_tests.rs (RED first at 64e3d03: the function did not exist): {256, 512, 1024, 2048} × three paths, the default row, the refusal-code row. Contract contracts/apr-finetune-config-truth-v1.yaml (kind: pattern); README 1812 contracts.

Acceptance, re-run by the orchestrator on 2beca0d

A_i rc
cargo test -p apr-cli --lib finetune_seq_len_truth 0 (4 passed)
cargo test -p apr-cli --lib finetune (80 tests) 0
cargo fmt --all -- --check · cargo clippy -p apr-cli --lib -- -D warnings 0 · 0
pv validate · pv lint · check_contract_test_binding.sh · check_contract_enforcement.sh · check_readme_claims.sh · check_no_claim_literals.sh · check_roadmap_diff_additive.sh valid · PASS · 0 ×5

Mutation — RED, then restored GREEN: the Wgpu branch returns Ok(512) regardless of the request → effective_max_seq_len_wgpu_never_clamps_to_the_old_512_literal FAILED, effective_max_seq_len_honours_every_requested_value_on_every_path FAILED (2/4) → restored 4/4.

Recorded: the card's --test finetune_seq_len_truth integration target became a #[cfg(test)] module of commands::finetune (an integration test cannot reach the crate-private commands tree; the lib.rs seam is blocked by the pre-commit complexity gate on pre-existing debt — same finding as R-3); the test drives the pure function, an end-to-end wgpu run is T-0's harness. Receipt for this PR itself: advisory, not produced (driver A1).

…e 512 literal at finetune.rs:717 is gone); one effective_max_seq_len() for every path, printed as Max seq len (PMAT-1009, #2924)

Pmat-Ticket: PMAT-1009
…ve max_seq_len equals the request or the command refuses with the documented code; README contract count 1812 (PMAT-1009, #2924)

Pmat-Ticket: PMAT-1009
@noahgift
noahgift enabled auto-merge September 6, 2026 05:47
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=3005 head=ea91bbb96507e64b0640ba20982b98f930ad351a verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

@noahgift
noahgift added this pull request to the merge queue Sep 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 6, 2026
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