Repository navigation
Conversation
… provided), the pinned CUDA source beside the model Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: CLEAN: the change moves the arena's page source behind a trait. I found no failure path, and the behavior matches the old Pinned path line by line.
Non-blocking
⚠ The new traits have one production implementer: crates/gpu/src/host/nvtier.rs:293 adds ArenaPages and PageSource, and only PinnedSource in crates/gpu/src/model.rs:1901 implements them outside tests. The Metal crate does not reference the tier yet, and docs/research/metal-offload.md:194 plans an enum kind Shared, not a trait. The test source HostSource is the only second implementer. Keep this only if the lift of the tier core follows soon. Otherwise a Shared enum variant is one element, not two traits plus a Box<dyn>.
⚠ Comments still say "pinned arena" for the provided case: nvtier.rs:2375 ("none on a pinned arena") and nvtier.rs:2496 describe give_back, which is now the Provided rule. The head comment was already updated to "provided". Make these two match it. docs/research/metal-offload.md:194 still names ArenaKind::Pinned and ArenaMem::pinned.
⚠ GPU evidence is partial: the body gives the base hash a9753394e only, no nvidia-smi line, and no command output. The body says the head moved by a rebase, so the box gates ran on a different tree. This does not change the verdict. The CONTRIBUTING.md evidence list is the reference.
Checked
- Duplicates: 7 new items checked (
ArenaPages,PageSource,PinnedSource,PinnedPages,arena_kind_of,ArenaMem::provided,eight_tier_over), none duplicated. dryer reported 0 pairs. - Complexity: crapper flagged no function.
- Silent failure: 3 sites followed. A length mismatch and a misaligned base are
assert!s (active in release) and name the source.device_base() == Nonereachescard_arena()anddevice_slot()asNone, and the test pins it.give_backonProvidedisOk(()), the same as the oldPinned. - Behavior equivalence:
dev_at(skip)equals the olddev_at(base - host_at(0)), andskipis the old alignment offset. Pinned-memory drop order is unchanged, sinceMappedHostmoved into theBox. - Hot path: none (carve and load time only).
give_backstill matches on the enum, with nodyncall per step. - Tests: for the length check, a mutant that drops the
bytes() == lenassert turns..._refuses_pages_of_another_lengthred. For the alignment check, a dropped assert turns..._first_byte_off_the_direct_alignmentred. Forgive_back, a mutant that advises provided pages zeroes theHostPagesmap, so "after a give-back" fails. For the device address, a base of 0 turnsSome(DEV + at)red. - Gates: no pin moved, none removed.
- Escape catalog: no pattern matched (no shell in the diff).
Notes
Aim: no finding came from dryer or crapper.
Card check: needs-gpu. This pull request changes crates/gpu/src/host/nvtier.rs, crates/gpu/src/model.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)
The tier arena's memory had one hard-coded source: pinned CUDA host pages. A Mac (unified memory) or another backend needs to hand the arena pages it already owns. This change puts that behind a
PageSource/ArenaPagestrait, with two kinds:Anon(the arena maps its own pages) andProvided(a backend gives them).ArenaMem::providedrefuses by name a length or alignment the arena cannot use. The CUDA source (PinnedSource,PinnedPages) lives incrates/gpu/src/model.rs, so the host side of the arena has no CUDA code in it.Proof (move class):
just canon-check a9753394e --worktree: 4 bins, 1633 entries, 1633 identical, rows equal. No kernel and no launch moved.Gates:
just affectedgave 169; the four scan pairs are identical, so the narrowed list is 111. Fixture tier: 76 items, red 0.gate-gpu-lib420 passed. Real tiergate-gpu-nvtierrc 0.FAIL-first: four new clauses (
a_provided_arena_*). Two mutants (the length/alignment check off; the device address read as 0 andMADV_DONTNEEDon provided pages) turn 3 and 4 tests red, as predicted.The box gates ran on base a975339. This rebase on main moves their keys; the next train batch re-runs them.
AI use: written and checked with Claude Code.
🤖 Generated with Claude Code