Skip to content

gpu, gate-paths: the tier page is reached over its link; host/link.rs holds the shared page, and the stage card, each tier card and the host take the page's addresses and words there - #96

Merged
midagedev merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-link
Oct 13, 2026

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

This is item 4 of docs/contrib/dgx-spark.md §8.9, a Link seam where the tier page is written and read, with only the shared-page impl; the mirrored region of §8.6 would be a second impl and is not part of this PR. The stage card, each tier card and the host now take the page's device addresses and words from crates/gpu/src/host/link.rs instead of the page's MappedHost, and every address, value and operation the protocol enqueues or touches is the one it was. Part of #13 (P5's protocol half, started in 6135340457).

Where each address comes from now
  • Link holds the page's bytes, which today are one MappedHost allocated in the stage card's context. LinkEnd is one side's view of the page: the device address of each byte as that side's launches, copies and stream memory operations take it.
  • The stage card's go and wait batches and its image and rows windows take their addresses from Link::stage_end.
  • A tier card gets its end from Link::tier_end when it is bound. Its go wait, staging copies (q8_1 and F32), routed-rows windows, fault copy and signal take their addresses from that end. The check in TierCard::bind that the page sits at the stage card's address in the tier's context moved into tier_end with the same condition, error and message.
  • The host's progress and fault reads, and its release and reset writes, go through Link::word.
  • tools/gate-paths.tsv: the weekly-gpu-ds41-lost trigger row, which lists host/{mod.rs,tier.rs,batch.rs} for the tier card's wait_for and lost_detail, now lists host/link.rs too, since those read their words there.

Code shape

The review reads these first. A box left unticked needs one line of why.

  • No second copy. The bind address check moved into Link::tier_end; it was not copied. TierPage::dev is gone, and every device address now comes from a LinkEnd.
  • Model code holds only architecture facts. No model crate changes. GLM and Qwen3.8 reach the changed code through the common TierCard.
  • Dead code is gone. TierPage::dev and the MappedHost import in tier.rs.
  • No silent failure. A tier card with no end refuses every row by name, with the same error an unbound card gave before (the row check).
  • Comments state what is true now. (tools/check-comments.sh ok.)
  • No relaxed gate. No band, tolerance or lint moved. One weekly trigger row gains host/link.rs (above), so the same weekly is still named when that code changes.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line), or "none": none.

What I ran

This is the move class in AGENTS.md's table, which asks for just ptx-scan identical and the host dispatch's structural lines (graph node count, eager = replay, e2e set identical). I checked the PTX md5 blocks, the graph node counts and the tier clauses' output on base and head. I did not run the e2e set (see "Not run here").

Rebased onto main at bd29e9c9 with no conflicts. git range-diff shows the commit unchanged (6d0dc9ea is now f690d6f6), and main has not touched crates/gpu/src/host/ since ef641faf. The runs below are on 6d0dc9ea. On f690d6f6 I reran only tools/mac-check.sh check on the Mac: rc 0, 25 bloomery crates checked or compiled.

On a Mac, at 6d0dc9ea

Both passed. The block below is abridged and reformatted: the eleven check-script lines are merged into one, and the timings and long tails are cut.

$ just mac-static upstream/main
mac-static: fmt-check rc 0 (rustfmt diff blocks: 0)
mac-static: lint rc 0 (lint ^warning: 41 = the ratchet 41 in tools/lint-ratchet.txt)
mac-static: combos rc 0 (0 shapes run, 0 red, 48 skipped (scoped))
mac-static: check-arch, check-comments, check-defaults, check-levers, check-loads, check-ptx-names,
            check-records, check-recipes, check-rustflags, check-unsafe, check-waits: rc 0 each
mac-static: ok
$ just mac-test
mac-check: test rc 0; 12 crates; 1105 passed, 0 failed, 177 ignored in 45 test binaries

On a DGX Spark

The PTX scan (1) ran before my last rebase, on base 8fb237f2 and a head with the same crates/ tree as 6d0dc9ea (bd46915a). 8fb237f2's crates/ tree is the same as ef641faf's (d75a9407). The gate runs (2) are on ef641faf and 6d0dc9ea themselves. Base and head were built with the same toolchain in the same container.

1. PTX. BLOOMERY_ARCH=sm_86 just ptx-scan <bin> --features <features> --no-jit on base and head, for the three bins of tools/recipes.py scan-set plus generate_ds41 and gate_e2e. The scanner refuses sm_121 even with --no-jit, so these are the sm_86 PTX.

bin features md5 block, base head
bloomery-serve-ds41 deepseek41,vision f631523a0c390751 same
gate_kquant gpu 99b5adffcb8d9ca6 same
gate_swap gpu 1d822d0aa255f44c same
generate_ds41 gpu,deepseek41 08f2485726dad9b6 same
gate_e2e gpu 127a65e7fe8cdf8e same

The ptxas columns are equal too.

2. Structural lines, from the tier loopback with local stand-ins. I used gate_deepseek41_tier, the V4.1 tier loopback, which puts the expert tier on a second Gpu on the stage's own card, with BLOOMERY_TIER=fixture. As shipped, gate-gpu-ds41-tier stops at exit 66 on this machine: tools/ref/ref-paths.sh:143-147 asks for the DSpark fixture draft, which a contributor cannot make (the v41 draft is not fetchable). The bin also reads that draft's header for the tier plan's draft reserve, and it reads engram/corpus-prose.ids from $BLOOMERY_DATA, which the published refsets do not carry. So I ran the bin through tools/box.sh local mode with four stand-ins, the same on base and head:

  • BLOOMERY_DSPARK_MODEL set to a placeholder path. This only gets the run past the draft check in ref-paths.sh, which takes a caller's path as given. With the next stand-in, and without --bfeat, the bin never opens it.
  • A draft reserve of 0 B, patched into the gate where it reads the draft's header.
  • The tier depth capped at 23 experts a layer, the gate's REAL_K3 for the real file. With a reserve of 0 B the GB10's room would put the whole stack of 192 on the tier.
  • 4096 prompt ids in place of the tokenizer's prose, from the LCG x = 6364136223846793005 * x + 1442695040888963407 mod 2^64 with seed 20261013, stepped before each id, and id = 1000 + (x >> 33) mod 100000. The command below writes them (sha256 27cc28dbcc6521ecc31df2024c8358c74541a3f6ec97a94f1c442d3fc53cc84b).

With these stand-ins it is not the owning gate's run, so I do not count gate-gpu-ds41-tier as green. What the runs show is that base and head behave the same under one set of conditions.

The commands, run in a tree with the stand-in patch below applied to gate_deepseek41_tier.rs, and with BLOOMERY_DATA pointing at the published refsets:

mkdir -p "$BLOOMERY_DATA/engram"
python3 -c 'x = 20261013
for _ in range(4096):
    x = (x * 6364136223846793005 + 1442695040888963407) % 2**64
    print(1000 + (x >> 33) % 100000)' > "$BLOOMERY_DATA/engram/corpus-prose.ids"
BLOOMERY_BOX_LOCAL=1 BLOOMERY_MODEL=deepseek41 BLOOMERY_DSPARK_MODEL=/nonexistent/dspark-draft.gguf \
  BLOOMERY_BOX_ENV='BLOOMERY_TIER=fixture BLOOMERY_GATE_BOUND=1800' \
  ./tools/box.sh 'export BLOOMERY_GATE_V41_LOAD=1 && cargo oxide build --arch sm_86 -- -p bloomery-gpu-gates \
  --features deepseek41 --release --bin gate_deepseek41_tier && BLOOMERY_GATE_CARD=any \
  bash tools/gpu-gate.sh gate_deepseek41_tier <clauses>'
  • --union --fault --two --batch --batch2 --bfault: PASSED on base and on head, 13 ok lines each.
  • --bfirst --blost --lost (the one-card line of weekly-gpu-ds41-lost): PASSED on base and on head, 9 ok lines each.
  • With the timings masked, the two outputs are identical except for the count of early settles (base 189 of 192, head 188 of 192). That count depends on timing: an earlier pair of runs on the same trees gave base 188 and head 189.

The card, printed before each run (the same on base and head):

$ nvidia-smi
| NVIDIA-SMI 595.84                 Driver Version: 595.84         CUDA Version: 13.2     |
$ nvidia-smi --query-gpu=name,driver_version --format=csv,noheader
NVIDIA GB10, 595.84

Head's output with the stand-ins, abridged: I kept the stand-in and plan lines and some of the clause lines, and cut the rest, including the build output. The P5LOCAL lines come from the stand-in patch. First --union --fault --two --batch --batch2 --bfault:

P5LOCAL: no DSpark draft fixture here, the tier plan takes a draft reserve of 0 B
P5LOCAL: the tier takes 23 experts a layer (the real file's depth 23 at most)
plan: gate card GB10, 1344 experts on it by the id prefix; tier: the last 23 of each routed layer's list on 7 layers (161 experts), stage keeps the rest
ok T1 (step, 32 steps, pairs, eager): 76 positions, tokens and logits bit for bit the reference's
ok T1 structure: stage graph of Some(288) nodes, the reference's
tier: 532 layers asked, 192 settles (188 early), hits 198 over 7 layers; graph nodes step Some(64) pair Some(127)
ok T2: the step fails with the tier's fault: layer 2 site quant_column; sites raised in layer 2 (Deepseek41 step order): quant_column
ok T2: after the reset the prompt's last position is the reference's
ok B7 (one batch against the steps, then greedy steps): 5 positions, tokens and logits bit for bit the reference's
ok B7 group (two batches against the reference's call, then greedy steps): 5 positions, tokens and logits bit for bit the reference's
ok B2 (after the reset, the prompt call against the steps): 5 positions, tokens and logits bit for bit the reference's
gate_deepseek41_tier: clauses: 6 ran, 0 left to the real tier
PASSED: gate_deepseek41_tier

Then --bfirst --blost --lost, abridged the same way:

ok B3f: the prompt call fails in 10.5 s naming the lost card: Hybrid::serve_batch: layer 2: the expert tier on GB10 did not finish its service of the prompt block's columns 0..64 in 10s: the card is lost
ok B3: the prompt call fails in 10.5 s naming the lost card: Hybrid::serve_batch: layer 2: the expert tier on GB10 did not finish its service of the prompt block's columns 0..64 in 10s: the card is lost
ok T3: the step fails in 10.1 s naming the lost card: Hybrid::serve: layer 3: the expert tier on GB10 served 28 of the 35 layers asked of it and signalled nothing more in 100.0ms: the card is lost
ok T3: the next step is refused by the lost card's poison: deepseek41 Body::decode_input: an earlier hybrid service failed and released the stream: Hybrid::serve lost the expert tier's card GB10 at layer 3: the expert tier on GB10 served 28 of the 35 layers asked of it and signalled nothing more in 100.0ms: the card is lost
gate_deepseek41_tier: clauses: 3 ran, 0 left to the real tier
PASSED: gate_deepseek41_tier

Against the move row's structural lines:

  • Graph node count: the stage graph has 288 nodes, the reference's, on both sides. The tier graphs have 64 nodes (step) and 127 (pair) on both sides.
  • Eager = replay: T1 checks the step, 32 steps, pairs and eager runs bit for bit against the reference, on both sides.
  • E2e set identical: not run here (below).

The host's progress read through Link::word runs in T1's step, pair and eager settles, and in T3 (--lost) the host also reads it through TierCard::wait_for from the stage wait's error path (host/mod.rs, TIER_GRACE).

The stand-in patch to gate_deepseek41_tier.rs (not in this PR)
-        let draft = dspark::draft_hparams()?;
-        let reserve = dspark::draft_reserve(Place::Bp, &draft.0, std::path::Path::new(&path))?
-            .ok_or("plan (b′) made no draft reserve")?;
+        let _ = (Place::Bp, &path);
+        let reserve: u64 = 0;
         let k3 = tier_depth(
             &inputs,
             &bloomery_gpu_gates::tier::plan_levers(&split()?, &levers, reserve)?,
             reserve,
         )?;
+        let k3 = k3.min(REAL_K3);

REAL_K3 is the gate's own constant for the real file's depth, 23. The patch also prints one P5LOCAL line for each of these two stand-ins.

Not run here

These are what a maintainer would run on the workstation:

  • gate-gpu-ds41-tier as shipped: the real draft reserve, depth and prompt ids, and --bfeat (B8), which reads the DSpark draft's header.
  • weekly-gpu-ds41-lost, its second line (gate_deepseek41_twocard --lost, BLOOMERY_CARD=both).
  • gate-gpu-ds41-twocard, gate-gpu-glm5next-twocard and gate-gpu-qwen38-twocard. Local mode refuses BLOOMERY_CARD=both (exit 64). These gates run the F32 staging copy (GLM and Qwen3.8 hand the tier F32 activations, V4.1 hands q8_1), and they put a tier on a second physical card, where Link::tier_end compares the page's address in two cards' contexts.
  • gate-gpu-e2e, for the e2e set. It needs the V2-Lite file and its ik reference, which I do not have here.

python3 tools/recipes.py affected upstream/main --no-box selects 108 of 154 gate recipes and 1 of 8 weekly recipes (weekly-gpu-ds41-lost, by the trigger row above). It reaches the gate recipes through the dependency walk, since every one of those bins links bloomery-gpu. I picked the runs above by the move row instead (identical scans plus the structural lines, on the paths this change touches) and did not run the other selected recipes.

Docs this makes stale

I left the docs alone. These lines go out of date:

  • docs/contrib/dgx-spark.md:222 and :717 cite host/tier.rs:561 for the tier page's cuMemHostAlloc. It is now host/link.rs:45.
  • docs/contrib/dgx-spark.md:687, :727, :739, :741, :743 and :785 cite lines 14 to 53 of tier.rs's module doc. That doc is one line longer now. The counter rule that :727 cites as tier.rs:14-18 is now at 16-19, since its paragraph was rewrapped. The other cited ranges move down by one (for example tier.rs:48-53 is now 49-54).
  • docs/contrib/dgx-spark.md:719 says the page sits "behind a Link seam with two impls", and §8.9 item 4 (:840) and the P5 row (:341) list the seam as open. After this PR the seam exists with one impl.

Hardware (if the change is for a machine)

  • One DGX Spark (GB10, cc 12.1), host driver 595.84, in a CUDA 13.3.1 dev container, tools/box.sh local mode. Inside the container nvidia-smi reads NVIDIA GB10, 595.84 too. I did not record which libcuda the gate process loaded. The gate kernels were built for sm_86 and JIT-compiled on the card. Inputs: the v41 fixture from fixture fetch and the published midagedev/bloomery-refsets, plus the stand-ins above.
  • The Mac: Apple M4 Pro, rustc 1.100.0-nightly (e457a7b0d 2026-08-27).
  • These are pass and fail results, not timings.

… holds the shared page, and the stage card, each tier card and the host take the page's addresses and words there

The tier protocol enqueued device addresses straight from the page's MappedHost. Each side now
takes them from its end of the link (LinkEnd): the stage card's go and wait batches and its
windows from Link::stage_end, a tier card's go wait, staging copies, fault copy, signal and
row windows from the end Link::tier_end made at bind, and the host's progress, release, reset
and fault reads from Link::word. The link is the shared page, so every end is the page's one
device address and every operation, address and value is the one it was.

TierCard::bind's address check moved into Link::tier_end with its message unchanged; it binds
the tier's context itself.

The weekly-gpu-ds41-lost trigger row of tools/gate-paths.tsv lists host/link.rs, where the tier
card's wait_for and lost_detail now read their words.
@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev 리베이스 완료했습니다. 리뷰 부탁드립니다.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: The page-access move preserves addresses, protocol operations, error handling and ownership order.

Non-blocking

⚠ Complete the move-class evidence: crates/gpu/src/host/tier.rs:1220. The base contract (AGENTS.md:88) requires an e2e-set comparison, which the PR reports was not run.
The supplied runs use a patched one-card loopback. They do not exercise the F32 staging copy or address validation across two physical cards.
Attach base/head just gate-gpu-e2e output and the owning two-card gate outputs when the fixtures and hardware are available.

Checked

Duplicates: Link delegates allocation and atomic bounds to MappedHost; the tier address check moved without a second copy.
Complexity: Parts::enqueue_layer's existing row/column validation now also requires an endpoint.
Silent failure: invalid flag-word offsets reach the invariant panic; missing endpoints return a named error before enqueueing. CUDA errors propagate.
Tests: no new or changed tests; mutation checks do not apply.
Gates: no pins or clauses moved; the weekly lost-card trigger adds link.rs.
Performance: derived from the diff, decode/prefill dispatch adds 0 allocations, launches, copies or synchronizations per tier layer. The change is in the move class.
Adversarial checks: mismatched device addresses fail before binding; unbound and boundary rows fail before access; reset retains the endpoint and page; cards and windows drop before the allocation.
Escape catalog: no C1–C4 patterns matched.

Notes

GPU evidence: false. Validation used static inspection; no build or GPU gate was run.

Card check: needs-gpu. This pull request changes crates/gpu/src/host/link.rs, crates/gpu/src/host/mod.rs, crates/gpu/src/host/tier.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)

@midagedev
midagedev merged commit bab2828 into midagedev:main Oct 13, 2026
7 checks passed
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 14, 2026
…link as generations; a loopback link carries them between two pages on one machine with a host pump

A row's go counter is added to by the stage card and taken back by the tier, and its done counter the
other way. Across two pages a copy of the writer's absolute value would erase the reader's take back,
and a captured wait keeps one fixed target on every replay. So on the loopback each counter is split:
on the writer's page only the writing card adds to it (a generation), and for each new generation the
pump copies the bytes it publishes to the reader's page (a go: the row's image; a done: the row's
routed rows and the tier's fault copy), writes the progress for a done, and then adds one to the
counter on the reader's page, where the reading card's wait and take back are the shared page's. The
step is checked before anything is published: 0 carries nothing, 1 carries one, and any other step
publishes nothing and stops the pump by name, so the host sees the tier behind and the lost tier's
detail names the step. The host's progress word on the stage card's page counts the dones carried, so
it never runs ahead of their bytes.

A release stops its own counter. A reset takes that counter's generations as carried, restarts its
tier's progress count from the tier's page and resumes that counter alone, so a counter still released
keeps what its writer adds until its own reset; a broken relay stays stopped across any reset. At rest
means every generation carried, the reader's counter at 0 and no relay broken. Link::broken also names
a pump thread that ended, and the not-at-rest error of a reset's check carries it, as lost_detail does.

host/link/pump.rs holds the relay (Relay, Relays) over a Page trait, with four host tests: the step
rule across the u32 wrap; two model cards over the pump thread for 2000 goes and dones from a
generation near the wrap, then a release, three more layers the cards run with nothing carried, the
go's and the done's resets taken apart with the pump running between them, and 2000 more (every go
carries its image, every done its rows, the progress counts every done, both counters end at rest); a
reset of one counter that leaves another, released, stopped until its own; and a doubled done with
raised rows that publishes nothing. Link::new picks the link's kind; the loopback allocates the tier
cards' page in the first tier's context and starts the pump thread through threads::helper::spawn_helper,
floating, so it never shares a pinned load thread's cpu; TierLayout::crossings lists the counters and
their spans. Link::store writes the tier cards' page first. The tier protocol's code
is the same over both links.

BLOOMERY_TIER_LINK (shared | loopback, unset shared, a mode) picks the link where
HostTier::attach_tiers builds the page, through bloomery_levers::tier_link, read below every binary's
main. On the shared page nothing changes. weekly-gpu-ds41-lost runs gate_deepseek41_tier's T1, T2, B7,
B2 and its lost-card clauses over the loopback after its shared-page line; that recipe's trigger row in
tools/gate-paths.tsv lists host/link/pump.rs, its tools/box-fill.tsv row says it runs the loopback,
and tools/defaults-twins.tsv names the recipe's shared-page line as the loopback pin's twin.
tools/spawn-allow.txt holds the relay tests' two threads.

docs/contrib/dgx-spark.md: section 1's P5 row and file list, section 9's opening, 9.5 (the impls and
item 2), 9.6 (item 3 and what carries to N = 4) and answer 20 describe the relay on the plan the
maintainer agreed to in midagedev#127, and 9.6 item 3 records that the maintainer takes it on midagedev#96's structural
proof in place of a same-lease A/B. The lines it cites in host/tier.rs and host/link.rs are updated.
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 14, 2026
…link as generations; a loopback link carries them between two pages on one machine with a host pump

A row's go counter is added to by the stage card and taken back by the tier, and its done counter the
other way. Across two pages a copy of the writer's absolute value would erase the reader's take back,
and a captured wait keeps one fixed target on every replay. So on the loopback each counter is split:
on the writer's page only the writing card adds to it (a generation), and for each new generation the
pump copies the bytes it publishes to the reader's page (a go: the row's image; a done: the row's
routed rows and the tier's fault copy), writes the progress for a done, and then adds one to the
counter on the reader's page, where the reading card's wait and take back are the shared page's. The
step is checked before anything is published: 0 carries nothing, 1 carries one, and any other step
publishes nothing and stops the pump by name, so the host sees the tier behind and the lost tier's
detail names the step. The host's progress word on the stage card's page counts the dones carried, so
it never runs ahead of their bytes.

A release stops its own counter. A reset takes that counter's generations as carried, restarts its
tier's progress count from the tier's page and resumes that counter alone, so a counter still released
keeps what its writer adds until its own reset; a broken relay stays stopped across any reset. At rest
means every generation carried, the reader's counter at 0 and no relay broken. Link::broken also names
a pump thread that ended, and the not-at-rest error of a reset's check carries it, as lost_detail does.

host/link/pump.rs holds the relay (Relay, Relays) over a Page trait, with four host tests: the step
rule across the u32 wrap; two model cards over the pump thread for 2000 goes and dones from a
generation near the wrap, then a release, three more layers the cards run with nothing carried, the
go's and the done's resets taken apart with the pump running between them, and 2000 more (every go
carries its image, every done its rows, the progress counts every done, both counters end at rest); a
reset of one counter that leaves another, released, stopped until its own; and a doubled done with
raised rows that publishes nothing. Link::new picks the link's kind; the loopback allocates the tier
cards' page in the first tier's context and starts the pump thread through threads::helper::spawn_helper,
floating, so it never shares a pinned load thread's cpu; TierLayout::crossings lists the counters and
their spans. Link::store writes the tier cards' page first. The tier protocol's code
is the same over both links.

BLOOMERY_TIER_LINK (shared | loopback, unset shared, a mode) picks the link where
HostTier::attach_tiers builds the page, through bloomery_levers::tier_link, read below every binary's
main. On the shared page nothing changes. weekly-gpu-ds41-lost runs gate_deepseek41_tier's T1, T2, B7,
B2 and its lost-card clauses over the loopback after its shared-page line; that recipe's trigger row in
tools/gate-paths.tsv lists host/link/pump.rs, its tools/box-fill.tsv row says it runs the loopback,
and tools/defaults-twins.tsv names the recipe's shared-page line as the loopback pin's twin.
tools/spawn-allow.txt holds the relay tests' two threads.

docs/contrib/dgx-spark.md: section 1's P5 row and file list, section 9's opening, 9.5 (the impls and
item 2), 9.6 (item 3 and what carries to N = 4) and answer 20 describe the relay on the plan the
maintainer agreed to in midagedev#127, and 9.6 item 3 records that the maintainer takes it on midagedev#96's structural
proof in place of a same-lease A/B. The lines it cites in host/tier.rs and host/link.rs are updated.
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 14, 2026
…link as generations; a loopback link carries them between two pages on one machine with a host pump

A row's go counter is added to by the stage card and taken back by the tier, and its done counter the
other way. Across two pages a copy of the writer's absolute value would erase the reader's take back,
and a captured wait keeps one fixed target on every replay. So on the loopback each counter is split:
on the writer's page only the writing card adds to it (a generation), and for each new generation the
pump copies the bytes it publishes to the reader's page (a go: the row's image; a done: the row's
routed rows and the tier's fault copy), writes the progress for a done, and then adds one to the
counter on the reader's page, where the reading card's wait and take back are the shared page's. The
step is checked before anything is published: 0 carries nothing, 1 carries one, and any other step
publishes nothing and stops the pump by name, so the host sees the tier behind and the lost tier's
detail names the step. The host's progress word on the stage card's page counts the dones carried, so
it never runs ahead of their bytes.

A release stops its own counter. A reset takes that counter's generations as carried, restarts its
tier's progress count from the tier's page and resumes that counter alone, so a counter still released
keeps what its writer adds until its own reset; a broken relay stays stopped across any reset. At rest
means every generation carried, the reader's counter at 0 and no relay broken. Link::broken also names
a pump thread that ended, and the not-at-rest error of a reset's check carries it, as lost_detail does.

host/link/pump.rs holds the relay (Relay, Relays) over a Page trait, with four host tests: the step
rule across the u32 wrap; two model cards over the pump thread for 2000 goes and dones from a
generation near the wrap, then a release, three more layers the cards run with nothing carried, the
go's and the done's resets taken apart with the pump running between them, and 2000 more (every go
carries its image, every done its rows, the progress counts every done, both counters end at rest); a
reset of one counter that leaves another, released, stopped until its own; and a doubled done with
raised rows that publishes nothing. Link::new picks the link's kind; the loopback allocates the tier
cards' page in the first tier's context and starts the pump thread through threads::helper::spawn_helper,
floating, so it never shares a pinned load thread's cpu; TierLayout::crossings lists the counters and
their spans. Link::store writes the tier cards' page first. The tier protocol's code
is the same over both links.

BLOOMERY_TIER_LINK (shared | loopback, unset shared, a mode) picks the link where
HostTier::attach_tiers builds the page, through bloomery_levers::tier_link, read below every binary's
main. On the shared page nothing changes. weekly-gpu-ds41-lost runs gate_deepseek41_tier's T1, T2, B7,
B2 and its lost-card clauses over the loopback after its shared-page line; that recipe's trigger row in
tools/gate-paths.tsv lists host/link/pump.rs, its tools/box-fill.tsv row says it runs the loopback,
and tools/defaults-twins.tsv names the recipe's shared-page line as the loopback pin's twin.
tools/spawn-allow.txt holds the relay tests' two threads.

docs/contrib/dgx-spark.md: section 1's P5 row and file list, section 9's opening, 9.5 (the impls and
item 2), 9.6 (item 3 and what carries to N = 4) and answer 20 describe the relay on the plan the
maintainer agreed to in midagedev#127, and 9.6 item 3 records that the maintainer takes it on midagedev#96's structural
proof in place of a same-lease A/B. The lines it cites in host/tier.rs and host/link.rs are updated.
juliankang4 added a commit that referenced this pull request Oct 14, 2026
…link as generations; a loopback link carries them between two pages on one machine with a host pump

A row's go counter is added to by the stage card and taken back by the tier, and its done counter the
other way. Across two pages a copy of the writer's absolute value would erase the reader's take back,
and a captured wait keeps one fixed target on every replay. So on the loopback each counter is split:
on the writer's page only the writing card adds to it (a generation), and for each new generation the
pump copies the bytes it publishes to the reader's page (a go: the row's image; a done: the row's
routed rows and the tier's fault copy), writes the progress for a done, and then adds one to the
counter on the reader's page, where the reading card's wait and take back are the shared page's. The
step is checked before anything is published: 0 carries nothing, 1 carries one, and any other step
publishes nothing and stops the pump by name, so the host sees the tier behind and the lost tier's
detail names the step. The host's progress word on the stage card's page counts the dones carried, so
it never runs ahead of their bytes.

A release stops its own counter. A reset takes that counter's generations as carried, restarts its
tier's progress count from the tier's page and resumes that counter alone, so a counter still released
keeps what its writer adds until its own reset; a broken relay stays stopped across any reset. At rest
means every generation carried, the reader's counter at 0 and no relay broken. Link::broken also names
a pump thread that ended, and the not-at-rest error of a reset's check carries it, as lost_detail does.

host/link/pump.rs holds the relay (Relay, Relays) over a Page trait, with four host tests: the step
rule across the u32 wrap; two model cards over the pump thread for 2000 goes and dones from a
generation near the wrap, then a release, three more layers the cards run with nothing carried, the
go's and the done's resets taken apart with the pump running between them, and 2000 more (every go
carries its image, every done its rows, the progress counts every done, both counters end at rest); a
reset of one counter that leaves another, released, stopped until its own; and a doubled done with
raised rows that publishes nothing. Link::new picks the link's kind; the loopback allocates the tier
cards' page in the first tier's context and starts the pump thread through threads::helper::spawn_helper,
floating, so it never shares a pinned load thread's cpu; TierLayout::crossings lists the counters and
their spans. Link::store writes the tier cards' page first. The tier protocol's code
is the same over both links.

BLOOMERY_TIER_LINK (shared | loopback, unset shared, a mode) picks the link where
HostTier::attach_tiers builds the page, through bloomery_levers::tier_link, read below every binary's
main. On the shared page nothing changes. weekly-gpu-ds41-lost runs gate_deepseek41_tier's T1, T2, B7,
B2 and its lost-card clauses over the loopback after its shared-page line; that recipe's trigger row in
tools/gate-paths.tsv lists host/link/pump.rs, its tools/box-fill.tsv row says it runs the loopback,
and tools/defaults-twins.tsv names the recipe's shared-page line as the loopback pin's twin.
tools/spawn-allow.txt holds the relay tests' two threads.

docs/contrib/dgx-spark.md: section 1's P5 row and file list, section 9's opening, 9.5 (the impls and
item 2), 9.6 (item 3 and what carries to N = 4) and answer 20 describe the relay on the plan the
maintainer agreed to in #127, and 9.6 item 3 records that the maintainer takes it on #96's structural
proof in place of a same-lease A/B. The lines it cites in host/tier.rs and host/link.rs are updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants