Skip to content

gates: preserve the requested host room in Qwen node measurements - #720

Merged
juliankang4 merged 3 commits into
midagedev:mainfrom
juliankang4:fix-qwen38-nodes-host-room
Oct 23, 2026
Merged

juliankang4 merged 3 commits into
midagedev:mainfrom
juliankang4:fix-qwen38-nodes-host-room

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

Qwen node 측정이 사용자가 정한 host room을 그대로 쓰도록 고치고, 같은 파일의 census 시험이 원격 조회를 실제로 검사하게 합니다.

Part of #565. Tracked in #699.

What and why

gate_qwen38_nodes --measure node starts a tier server as node 1. That server's command always set BLOOMERY_HOST_ROOM to 20G when a host tier was requested, so a measurement run with another host room (32G in the test below) still measured with 20G. The measured tier budget did not match the one the caller asked for, which can make two node measurements differ in host and NVMe placement for no reason the caller chose. The override came in with #411.

The fix moves the command into one function, node1_command, which takes the room as an Option<u64>. Some(bytes) sets the variable to those bytes. None adds no setting, so the server inherits the parent's environment. The measurement path hands over the room that the existing bloomery_levers::nvtier_levers()?.host_room already read, so no second parser was added and an invalid value is refused by that reader as before. The functional gate keeps its 20G room through one constant, GATE_HOST_ROOM, used by its five launcher calls.

The second commit fixes a weak test in the same file. census_clause_requires_the_remote_census only called census_specs on a dead address. It now builds a Common from the lever registry and calls census_plan, the function that runs in the gate, and checks that the error names the node at the unreachable address. Replacing the remote census with a local one makes it fail.

Release notes: Fixed: gate_qwen38_nodes --measure node runs its tier server with the requested BLOOMERY_HOST_ROOM instead of a fixed 20G.

Code shape

  • No second copy. node1_command is the only place that builds node 1's command. The room is read by the existing nvtier_levers owner. The five functional-gate calls share GATE_HOST_ROOM.
  • Model code holds only architecture facts. Only the gate binary changed. No model or common owner gained a branch.
  • Dead code is gone. The host: bool parameter of node1 is replaced by the room, and the unused census_specs import in the tests is gone.
  • No silent failure. An invalid room is an error from the lever reader, returned with ?. No fallback replaces the chosen room with 20G.
  • Comments state what is true now. The module doc says which room the functional gate and the measurements use.
  • No relaxed gate. No band, tolerance, pin or lint level moved.
  • cargo fmt and cargo clippy are clean on what I touched. rustfmt --check on the changed file ends with rc 0. cargo clippy has not been run on this head.

Duplication found or removed (path:line): none. The duplicate scan reported no candidates.

What I ran

The head is 8a24eb314a1907f90267168b3db60131f1386d95, two commits on main 648dd751d9ed25f9a18d8a404e5f08e3fb52e512. The tests below are a std-only projection, not the crate's own test binary. I extracted node1, node1_command, the measurement call and the new tests from the source and compiled them with rustc --edition=2024 --test. Process spawn and the lever read are replaced by fixtures. No GPU was used and no model was loaded.

Fail-first for the host room: on main, a 32G request reaches the server as 20G and the test fails (rc 101). On the head it reaches the server as 32G (rc 0).

Host room request main head
32G server gets 20G, rc 101 server gets 32G, rc 0
0 not run server gets 0, rc 0
unset not run server gets nothing, rc 0
requested=Some(34359738368) server=Some(21474836480)
test gate::tests::measurement_preserves_requested_host_room ... FAILED
requested=Some(34359738368) server=Some(34359738368)
test gate::tests::measurement_preserves_requested_host_room ... ok
requested=Some(0) server=Some(0)
requested=None server=None
nodesroom: main FAIL-first, head 4 test executions PASS; no GPU or model loaded

The head also runs the command-builder test over unset, 0, the gate constant and 32G, with rc 0.

Census test, same projection, with the first census lookup of census_plan kept as written: the old test ends with rc 0 even with the lookup removed. The new test ends with rc 0 on the head and rc 101 once the lookup is removed.

CASE_RC main-census-mutant 0
CASE_RC head-census 0
test gate::tests::census_clause_requires_the_remote_census ... FAILED
CASE_RC head-census-mutant 101

The fixture setup and the plan arithmetic after the lookup are stand-ins in this projection.

Other checks on the head: rustfmt --edition 2024 --config skip_children=true --check on the changed file ends with rc 0, and so does git diff --check. The duplicate scan ends with rc 0 and no candidates.

What I ran into

This does not block the PR.

  • The full census_clause_requires_the_remote_census test needs the Qwen model and corpus files that Common::new reads. I did not run it here, nor the GPU crate's own test binary or the functional gate, so the results above come from the projection only.
  • I did not measure arena size or speed, so nothing here claims a speed change. The verified effect is the room bytes that reach the tier server.
  • cargo clippy and just contrib-check have not been run on this head.

Hardware

The projection ran on a DGX Spark host. This change touches only the gate binary and uses no GPU memory; the card line below is the machine's own report.

NVIDIA GB10, driver 595.84, CUDA 12.1

just gate-gpu-qwen38-nodes not run: it needs the Qwen model and the gate workstation, which this check did not use.

AI help

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

@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 23, 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 measurement forwards the requested host room, and the functional gate retains its existing room.

Checked

Duplicates: 5 new source definitions and 16 probe declarations checked against existing owners; no actionable duplicates. No dryer pairs were available.
Complexity: run rose 26 → 27 from the fallible lever read; its dispatch structure is unchanged.
Silent failure: 5 optional/error sites followed. Unset room inherits, zero stays explicit, malformed room returns a named error, and unexpected census success panics.
Tests (static mutation tracing): forcing 20G at crates/gpu-gates/src/bin/gate_qwen38_nodes.rs:618 fails the command assertion; passing the gate constant at crates/gpu-gates/src/bin/gate_qwen38_nodes.rs:1753 fails the measurement probe for 32 GiB. Replacing the remote lookup at crates/gpu-gates/src/bin/gate_qwen38_nodes.rs:678 with local census fails the revised census assertion or reaches its explicit panic. Python syntax parsed; Rust tests were not executed here.
Gates: no threshold changed. The census test has a dated PIN, hardware-test naming and ignore attribute, and an explicit recipe invocation.
Performance: launcher setup and tests only; no per-token work changed.
Adversarial checks: unset, zero, malformed, unit-suffixed and maximum-u64 rooms preserve their registry semantics through the child command. The closed census endpoint fails before local card planning.
Escape catalog: no C1–C4 pattern matched.

Notes

dryer did not run, according to diagnostics.
The PR supplies std-only projection results, not full crate tests or a card gate run; GPU evidence is incomplete.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen38_nodes.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 1fc0e05 into midagedev:main Oct 23, 2026
7 checks passed
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 tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant