Skip to content

gpu, placement: test CPU tier heat and larger host pages - #814

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-def-tests
Oct 25, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-def-tests

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

CPU 계층의 Tick과 Heat 방출 규칙, 그리고 4 KiB보다 큰 호스트 페이지 계산에 빠져 있던 시험을 보태고, 운영 코드는 바꾸지 않습니다.

Follows up the review notes on #408 and #746.

What and why

This adds tests only. Production code, public APIs and kernels are unchanged. Two gaps are covered.

Host pages (crates/os/src/lib.rs, crates/placement/src/placement.rs). The OS layer accepts any power-of-two base page of at least 4 KiB, and the placement row room takes the page size as an argument. The existing tests stopped at 16 KiB. the_base_page_is_a_power_of_two_of_at_least_four_kibibytes now also checks that a 64 KiB page counts, and the_row_room_counts_the_hosts_base_page checks the 64 KiB row room, including the Split, Parts and NVFP4 cases. The 4 KiB and 16 KiB cases stay.

CPU tier eviction (crates/gpu/src/host/tier_cpu/tests.rs). The hardware fixture hw_held_node_nvme_host_run_keeps_eager_and_captured_rows ran only with the Tick rule. It now runs F32 and Q8 under both Tick and Heat. The first column carries a host expert and an NVMe expert, the second column the same NVMe expert, so the routing count of that expert shows whether the clock moves once per column. After the captured graph runs, two all-host columns are served and the test checks that the existing counts decayed by the matching factor. Under Tick no routing count may exist. The earlier checks on eager against graph output, refill, callback lifetime and fault and reset paths are unchanged.

Release notes: Under the hood: tests for the CPU tier's Heat eviction counts and for host pages larger than 16 KiB.

Code shape

  • No second copy. The tests reuse the existing OS and placement tests and the existing CPU tier fixture. One count-check closure is shared by the checks that use it.
  • Model code holds only architecture facts. No model file is touched.
  • Dead code is gone. Nothing was made unused.
  • No silent failure. An unexpected presence or absence of a routing count panics the test.
  • Comments state what is true now. The row room test comment now covers the 64 KiB case.
  • No relaxed gate. No band, tolerance, lint level or pin moved.
  • cargo fmt and cargo clippy are clean on bloomery-os and bloomery-placement. Clippy was not run on bloomery-gpu; its changed test compiled and ran on the GPU machine below.

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

What I ran

Each new check was also run against a deliberately broken build to show it can fail.

Pages, on a CPU machine, with the commands:

cargo test -p bloomery-os --lib -- the_base_page_is_a_power_of_two_of_at_least_four_kibibytes --nocapture
cargo test -p bloomery-placement --lib -- the_row_room_counts_the_hosts_base_page --nocapture
  • With counted_page set to refuse pages above 16 KiB, the OS test fails on the new 64 KiB assertion. With row_room set to cap the page at 16 KiB, the placement test fails on the new 64 KiB assertion, with 2,147,483,648 against the expected 8,589,934,592. Both tests pass on the restored code.
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 16 filtered out
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 196 filtered out

CPU tier, on the RTX 5090 machine below, with the commands:

bash tools/gate.sh --gpu --oxide -p bloomery-gpu --release --lib -- --include-ignored host::tier_cpu::tests::hw_held_node_nvme_host_run_keeps_eager_and_captured_rows --nocapture
bash tools/gate.sh --gpu --oxide -p bloomery-gpu --release --lib -- --include-ignored host::tier_cpu::tests::node_nvme_host_budget_keeps_the_os_reserve --nocapture
  • With the served-column count removed from the serve path, the fixture fails on the expert 127 count: 1.9156558791428497 against the expected 1.9785720620877.
  • With the step that skips the empty prefetch of an all-host column removed, it fails on the same expert: 43.87495422117509 against the expected 42.014800102697.
  • On the restored code the fixture passes for F32 and Q8 under Tick and Heat, and the host budget test passes.
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 419 filtered out
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 419 filtered out

just gate-gpu-lib not run: the full library gate belongs to the PR chain, and production code is unchanged, so no PTX comparison or speed measurement applies.

Hardware

The GPU commands ran on an RTX 5090 machine. nvidia-smi printed:

| NVIDIA-SMI 595.99.02              Driver Version: 595.99.02      CUDA Version: 13.2     |
|   0  NVIDIA GeForce RTX 5090        Off |   00000000:01:00.0 Off |                  N/A |

The CUDA version is the one nvidia-smi reports. The model is the Q8_0 fixture the test writes itself, so nothing is downloaded.

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 placement Placement planning: crates/placement labels Oct 25, 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 added page-size and CPU-tier assertions introduce no blocking defect.

Checked

Duplicates: 0 new functions, types or constants. The local count-check closure has no reusable duplicate. Dryer reported 0 pairs.
Complexity: node_nvme_host_run rose from 22 to 26 through eviction-mode assertions in the existing fixture.
Silent failure: 1 default followed. Tick legitimately has no counts; Heat storage is initialized once, and the assertions require Some.
Tests, static mutation check: rejecting pages above 16 KiB at crates/os/src/lib.rs:463 fails the new 64 KiB assertion.
Tests, static mutation check: capping the page at 16 KiB in crates/placement/src/placement.rs:3323 fails the 64 KiB Split, Parts and NVFP4 assertions.
Tests, static mutation check: dropping columns = 0 at crates/gpu/src/host/tier_cpu.rs:90 fails the first Heat count assertion; dropping the all-host prefetch at crates/gpu/src/host/tier_cpu.rs:95 fails the decay assertion. Existing host-budget assertions are unchanged.
Gates: no pins or tolerances moved; existing page-size cases remain, and the hardware test stays ignored.
Escape catalog: no patterns matched.
Performance: tests only; no production hot path changed.

Notes

The reported targeted RTX 5090 runs omit the tested commit hashes and do not include the required just gate-* run. GPU evidence is incomplete.
This review used source inspection; no builds or tests were run.

Card check: needs-gpu. This pull request changes crates/gpu/src/host/tier_cpu/tests.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 c5db83a into midagedev:main Oct 25, 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 placement Placement planning: crates/placement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant