Repository navigation
placement: refuse a host page size outside the row room - #408
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: Unsupported page sizes are refused before the machine reading or room override is accepted.
Non-blocking
⚠ Automate the injected-page regression: crates/model/src/placement/workstation.rs:124.
At 4096 bytes, this test only asserts success, so deleting the production guard at lines 24–29 leaves its assertions satisfied.
Run the PR's documented 16384/65536-byte shim cases, with and without the room override, through an existing gate to catch recurrence automatically.
Checked
- Duplicates: the new test is the only test of this host-page refusal found in the tree.
- Complexity: the production reader gains one guard; the test branches on the host page size.
- Silent failure: invalid page readings and mismatches return named errors; the placement caller propagates them through
PlacementError::HostRoom. - Tests: static mutation analysis shows the native 4096-byte branch would miss a deleted guard. The PR reports failure on base code with a 65536-byte shim and supplied room.
- Gates: no pins moved or cases removed.
- Escape catalog: C1–C4 do not match the diff.
- Performance: the change touches load-time room discovery; no decode or prefill work changes.
Notes
Validation was static; tests were not rerun. The PR reports CPU test runs and says full contributor checks and selected GPU gates were not run.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
What and why
Part of #53: refuse a host page size the placement row-room calculation does not support.
The host-room reader now checks
host_lock::page_bytes()againstROW_PAGEbefore reading the machine's room or acceptingBLOOMERY_HOST_ROOM. The existingsysconf(_SC_PAGESIZE)reader supplies the actual size, and the error names both sizes through the existing host-room refusal path.Release notes: Added: A named refusal when the host base page size differs from placement's 4096-byte row-page unit.
Code shape
host_lock::page_bytes(); no second system reader or page-size constant.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up. Clippy was not run here.Duplication found or removed: none.
What I ran
Delivery head:
30dc7fa19af640ed776c1e833dfb646f3c72aca1, rebased onto8e05ce8f28f115450902a8214047b543bc1d97df. The patch is unchanged; the intervening main commit changes only profiling scripts.Tested head:
08dc9d467e118e662440791a07c9d7503e844cf9. Tested base:b1eea0413738d36f0a5ea595e06995492b610fd3. Those native page-size results carry because the host-room reader, its page-size reader and the regression are unchanged.On each host, built the library test executable with:
cargo test -p bloomery-model --lib --no-run --message-format=jsonThen ran
placement::workstation::tests::host_room_refuses_another_row_page --nocapturewith the native page size and with a syscall shim reporting 16384 or 65536 bytes. Each size was tested with a machine-read room and withBLOOMERY_HOST_ROOM=1G. The shim was loaded into the test executable only, after compilation.Difference: native 4096 B reads still pass; a 65536 B reading with a supplied room is now refused instead of accepted.
Both hosts passed all six cases. On the base production code with only the regression test added, the 65536-byte case with a supplied room failed: the room was accepted as
(1073741824, Given).just affected b1eea0413738d36f0a5ea595e06995492b610fd3 --no-boxselected 167 of 184 gate recipes through the model crate. This lists affected gates; it does not run them. Full contributor checks and the selected GPU gates were not run here.Reproduction
Build the test executable normally, then run it under a small
LD_PRELOADshim that overrides onlysysconf(_SC_PAGESIZE):Compile the shim with
cc -shared -fPIC page.c -ldl -o page.so. Use the test executable path from Cargo'scompiler-artifactJSON row whose target name ismodel:The result is
Err("sysconf(_SC_PAGESIZE) is 65536 B; row room requires 4096 B pages").Hardware
DGX Spark with NVIDIA GB10 and driver 595.84, Linux aarch64; a Linux x86_64 CPU host without an NVIDIA GPU. Both hosts report 4096-byte base pages. Compiler:
rustc 1.100.0-nightly (e457a7b0d 2026-08-27). No model file is needed.What I ran into
The larger page sizes were injected syscall answers, not kernels booted with those page sizes. This does not block this PR: the test exercises the production reader and refusal, but does not claim full support for another page size.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.