Skip to content

gpu: carry the host reading in a tier node's census - #946

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-hostroom-node-census
Oct 29, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-hostroom-node-census

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

두 번째 노드가 보낸 호스트 메모리 여유 값에 그 값을 읽은 방법도 함께 실어, 노드 쪽 배치가 거절될 때 원인을 알 수 있게 고치는 수정입니다.

Part of #565.

What and why

A tier node reports its available host bytes (its host room) in the census it sends when node 0 connects. The census carried only the number. When the node's plan was refused for lack of room, the error gave no hint whether that number came from BLOOMERY_HOST_ROOM, MemAvailable, a cgroup limit or the machine's memory statistics.

The census now carries the reading next to the bytes: NodeCensus::host_room is a (u64, HostRead) pair, the same shape workstation::host_available_read() already returns. A refusal from the node's plan reads the node's host room <N> B (<reading>): ..., followed by the planner's own message. The reading goes on the wire as one tag byte after the room (a cgroup reading also carries its path), and an unknown tag is refused by name. The census layout changed, so the node protocol version goes from 5 to 6; a node on the old version is refused by the existing version check, which names it. The planner's arithmetic and the bytes it uses are unchanged.

docs/contrib/dgx-spark.md now says the census carries the reading.

Release notes: Fixed: a two-node tier refusal for lack of host room on the second node names that node's room and where the number was read from.

Code shape

  • No second copy. The reading reuses HostRead and host_available_read() from the placement code instead of a second type for the wire.
  • Model code holds only architecture facts. No model file is touched.
  • Dead code is gone. Nothing was made unused.
  • No silent failure. An unknown reading tag is a named error, and so is a payload from another protocol version.
  • Comments state what is true now.
  • No relaxed gate. No band, tolerance or lint moved.
  • cargo fmt --all -- --check is clean.

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

What I ran

Tested head bf18cd5a2eac1e7ee23d860c86d8a5b11d2cb4e5 on upstream main 248ed061df390aae21cf9fe0cdb29d0ff884d7ca, on a DGX Spark (GB10):

bash tools/gate.sh --oxide -p bloomery-gpu --release --lib -- a_census_keeps_its_host_reading node_nvme_host_budget_keeps_the_os_reserve messages_read_back_as_written --nocapture
bash tools/gate.sh --oxide -p bloomery-gpu-gates --features gpu --release --lib -- loopback_census_is_required_without_adding_a_pool
  • First command: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 447 filtered out; finished in 0.15s.
  • Second command: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 211 filtered out; finished in 0.01s, exit code 0.

The new test a_census_keeps_its_host_reading writes and reads a census for every reading kind, refuses a payload cut at any byte, refuses tag 255 as unknown host reading 255, and refuses a version 5 payload. node_nvme_host_budget_keeps_the_os_reserve now checks that a node with no room refuses with its room and each of the five readings in the message.

On the same head, the GPU library gate on a DGX Spark (GB10):

just gate-gpu-lib
  • test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 440 filtered out, including hw_held_node_nvme_host_run_keeps_eager_and_captured_rows.
  • test result: ok. 1 passed; 0 failed.

No timed measurement was taken; the change touches the census wire format and an error message, not device computation.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

@github-actions github-actions Bot added dgx-spark The DGX Spark (aarch64, GB10) port documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 29, 2026

@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 census carries the reading, the wire read and write match, an unknown tag and an old version are refused by name, and no failure path survived.

Non-blocking

⚠ The room prefix covers every planner error: crates/gpu/src/host/node.rs:372. expert_nvme_tier also fails for reasons that are not room (room.rs:801 "a host segment of a routed stack with no list", room.rs:825 "host experts … are not the other stacks'"). Those now read "the node's host room N B (…): …", which points at room when room is not the cause. Direction: keep it, or apply the prefix only to the room refusals if the planner gains a typed room error. No change is needed to merge.

⚠ A constant in a printed line: crates/gpu/src/host/tier_cpu/tests.rs:209. zero-room-refused=true is now a literal, because the refusal is asserted in the loop above. Nothing reads the field (Grep: one hit). Drop the field from the println!.

Checked

  • Duplicates: 6 new items checked (HostRead tag map, NodeCensus::read and write arms, the new test, the refusal text). None duplicated. HostRead::word() is a text form for record lines, not a wire tag, so it is not a second owner. dryer: 0 pairs.
  • Complexity: NodeCensus::read 21 → 29 and write 4 → 9 are even growth (one match arm per reading). node_nvme_host_run 26 → 27 is a test loop. Harmless.
  • Silent failure: 3 sites followed. Unknown tag returns Err("unknown host reading N"). A truncated cgroup path fails in i.str. A version 5 payload fails at the version check, before the new byte is read.
  • Tests: a_census_keeps_its_host_reading protects the tag map in write and read. Mutant: swap two tags in only one of the two matches. The round trip turns red. Mutant: drop the path from the cgroup arm. The round trip and the truncation loop turn red. Mutant: leave VERSION at 5. The version-5 case no longer fails by version, and its assert turns red. node_nvme_host_run protects the prefix in project. Mutant: drop the reading from the message. The contains assert turns red for each of the 5 readings.
  • Gates: no pins moved. Escape catalog: no pattern matched (no shell code in the diff).
  • Hot path: none (load time, wire census).

Notes

  • The PR body names a "DGX Spark (GB10)" but has no nvidia-smi line, and it names only the head hash and the upstream hash. gpu.json records evidence: false. The change is a wire and message change, so this does not affect the verdict.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/generate.rs, crates/gpu/src/host/node.rs, crates/gpu/src/host/node/wire.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)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 822b3f1 into midagedev:main Oct 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dgx-spark The DGX Spark (aarch64, GB10) port documentation Improvements or additions to documentation 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.

1 participant