Repository navigation
Conversation
… so a backend without the card engine can draft with it The MTP window policy and its tests now live in the host-only runtime crate, beside runtime::lookup and runtime::dspark. Metal will use them. It cannot link crates/app, which links the card engine. Moved, code unchanged except visibility, use lines and doc links: - app mtp/policy.rs: Policy, Shape, Refresh, Chain, Call, Walk, Exec, Fail, Refused, SKIPS, and 21 policy tests. - gpu draft.rs: Hidden and WalkMode. - app mtp.rs: the Join and Parked structs, and WHAT. The old paths re-export them. What names a card type stays: - Feed (CallRows); - DraftHead (check_opened returns GpuError); - From<StepMode>. Parked's byte codec (put/take/check, gpu::checkpoint::bytes) stays in app as the ParkedBytes trait. Refresh::feed stays as a private app trait. Its two byte tests stay in app. The only caller edit is drafted.rs's `use` line. Tests 24 before (policy 23, app 1) and 24 after (runtime 21, app 3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CjHkkntc2L1xRN21xB39mj
There was a problem hiding this comment.
Verdict: MUST_FIX: The moved codec test loses its saved-reason compatibility check.
Must fix
1. Keep the saved skip code tied to PROMPT_ARENA
crates/app/src/mtp.rs:1521 now selects SKIPS[3] from the same table the encoder searches. Swapping STORE_BEHIND and PROMPT_ARENA still produces code 4 for this fixture, so the assertion passes while saved codes 3 and 4 change meaning. The base fixture selected PROMPT_ARENA independently and caught this mutant.
This drops an existing compatibility clause without the dated reason required by the gate contract (kind B). Restore it in this move to keep later table edits from passing with changed saved-state meanings.
Replace skip: Some(SKIPS[3]), with the independent expected reason:
skip: Some(
"the rows waiting for the draft sat in a prompt call's arena when the \
sequence was parked, and a parked sequence keeps only the step's and \
the verify's",
),The existing code-4 assertion then rejects the table-swap mutant again.
Non-blocking
⚠ Complete the pending gate evidence: crates/app/src/mtp.rs:123. The PR supplies identical PTX scans but still lists the selected fixture batch as pending. Attach its just gate-* commands and output, card/driver line, both commits and model file. The move class needs no timed A/B.
Checked
Duplicates: 3 new adapter/test items checked; moved definitions and methods retain one owner. No dryer pairs were available.
Complexity: crapper unavailable; policy and codec bodies add no branches. The feed adapter has no branch.
Silent failure: 5 sites followed; optional window collection, two last-row substitutions and two chain caps preserve their defined contracts.
Tests: all 24 retained, split 21 runtime / 3 app. Static mutation review found the surviving table-swap mutant above; the other 23 test bodies match base. Rust tests were not executed.
Gates: no threshold moved; the saved-reason clause weakened as described in item 1.
Escape catalog: no C1–C4 pattern matched. Re-exports preserve type identity; codec method bodies match base after import normalization.
Notes
Dryer and crapper did not run because their Python modules were missing. GPU gates were not run during this review; the PR supplies no complete card gate evidence.
Card check: needs-gpu. This pull request changes crates/app/src/mtp.rs, crates/gpu-gates/src/bin/shared/serve_seats/drafted.rs, crates/gpu/src/draft.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
Superseded by #1155, which carries this commit and the second half (MtpDraft over a Host trait), rebased onto main after the uutils fix. |
What and why
The MTP window policy is card-free:
Policy,Shape,Refresh,Chain,Call,Walk,Exec,Fail,RefusedandSKIPS. It lived incrates/app, which links the card engine, so the Metal backend cannot use it. This PR moves it and its 21 tests to the host-onlyruntimecrate, besideruntime::lookupandruntime::dspark.The plain values it reads move too:
HiddenandWalkModefromgpu::draft, and theJoinandParkedstructs fromapp::mtp. The old paths re-export everything.The moved code is unchanged except:
pub(super)→pub);uselines;What names a card type stays where it is:
Feed(it holdsgpu::media::CallRows);DraftHead(check_openedreturnsGpuError);From<StepMode> for WalkMode.Parked's byte codec stays in app as the
ParkedBytestrait (put/take/check, overgpu::checkpoint::bytes), with its two tests.Refresh::feedstays as a private app trait. The only caller edit is oneuseline ingpu-gatesserve_seats/drafted.rs.This is the first half of #1135. The second half moves
MtpDraftitself behind aHosttrait.Release notes: internal — the MTP draft policy is shared code in
runtime, ready for a second backend.Code shape
Parkedstays one type, with the byte codec as an extension trait rather than a wrapper type.cargo fmt;just mac-lintratchet 0.Duplication found or removed: none. The app byte tests keep a small test-only
Ararena enum, since the runtime test module's is private.What I ran
The move proof uses
just narrow origin/main HEAD:--no-jitscans of the covering bin set on the box, base 99a6bfd, head c6e8c7c.The host files the move touches are linked by most bins, so 144 gates stay. They run as a fixture-tier batch; the result is below.
On the Mac:
FAIL-first on a moved test: changing
Policy::chain'sctx as usize - 1 - endtoctx as usize - endfails two tests,a_chain_takes_the_refresh_and_caps_its_own_walksandno_call_sequence_leaves_the_store_past_the_target_or_refuses(19 passed; 2 failed). The edit was reverted.Box batch (fixture tier): pending, added below when it ends.
AI use: Claude Code wrote this change (a Sonnet round, reviewed by the lead session, which ran the box proof).
🤖 Generated with Claude Code
https://claude.ai/code/session_01CjHkkntc2L1xRN21xB39mj