leonida-gpu: tests pin the list value waits (unsigned 64-bit compare, unmasked 32-bit reference) #3469

Merged
leonida/mandy
MoonEyes merged 6 commits from test/list-value-waits into main 2026-12-04 14:49:18 +00:00

Pull request successfully merged and closed

Member

Tests only: the list's value waits (ValueWait::holds_for) get pinned. 64-bit waits read no mask and compare unsigned. 32-bit waits pass the read value through the call's mask but keep the reference as given. No production line changes (git diff 30c6830550..99fc783296: one file, d3d12/crates/leonida-gpu/src/list.rs, 163 lines added, all in mod tests).

Tested:

  • cargo test -p leonida-gpu --locked: 758 passed, 0 failed
  • cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings: clean
  • python -I scripts/check_no_game_data.py on the file: clean
  • A separate reviewer re-ran the suite and broke holds_for on purpose twice (signed compare, then a masked reference). Each time exactly the expected test failed. The tree was restored afterwards.

No GPU needed. The host-list path (cut()) is still not covered, because it needs a GPU.

AI-assisted: written by Freebuff (ultra). Reviewed by Claude Opus 5.5 (Claude Code), acting as a separate judge. Opened and merged by Moon's agent on Moon's written authorization (two maintainers).

🤖 Generated with Claude Code

Tests only: the list's value waits (`ValueWait::holds_for`) get pinned. 64-bit waits read no mask and compare unsigned. 32-bit waits pass the read value through the call's mask but keep the reference as given. No production line changes (`git diff 30c6830550..99fc783296`: one file, d3d12/crates/leonida-gpu/src/list.rs, 163 lines added, all in `mod tests`). Tested: - `cargo test -p leonida-gpu --locked`: 758 passed, 0 failed - `cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: clean - `python -I scripts/check_no_game_data.py` on the file: clean - A separate reviewer re-ran the suite and broke `holds_for` on purpose twice (signed compare, then a masked reference). Each time exactly the expected test failed. The tree was restored afterwards. No GPU needed. The host-list path (`cut()`) is still not covered, because it needs a GPU. AI-assisted: written by Freebuff (ultra). Reviewed by Claude Opus 5.5 (Claude Code), acting as a separate judge. Opened and merged by Moon's agent on Moon's written authorization (two maintainers). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`wait_for` and the `LEONIDA_LIST_VALUE_PRODUCERS=0` path had no test. Three
now: a 32-bit wait compares the value through the call's mask (0x134 meets a
reference of 0x34, 0x135 does not), a 64-bit wait reads no mask and compares
unsigned (0xffff_ffff_ffff_ffff above 0xffff_ffff_ffff_fffe), and with the
switch off the wait keeps all ones and "other", as before #3439.

The switch and `queue::cuts` are read once per process, and a wait is kept in
`VALUE_WAITS` only when lists are not cut at it: each test runs again in a
child test process with its environment, as `replay::gpu::tests` does for a
handle's lifetime. No production code changed.

`cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: exit 0.
`cargo test -p leonida-gpu --locked`: 758 passed, 0 failed, 60 ignored.

AI-assisted (Freebuff, Buffy)
The three tests called `wait_for` itself; a list's table calls `wait_value`
and `wait_value64`, whose own mapping (the mask from the call, the all ones of
a 64-bit wait) was therefore untested. They call those two now, from the
pointer a list holds to `VALUE_WAITS`, and each wait's `place()` is asserted
(its address, and four or eight bytes), as is the engine at the last known one
(3, kept as it is) and past it (9, the fourth).

`cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: exit 0.
`cargo test -p leonida-gpu --locked`: 758 passed, 0 failed, 60 ignored.

AI-assisted (Freebuff, Buffy)
Each test named itself in a string literal for the child run; the name is now
built from the test's identifier by a small macro, so renaming a test cannot
leave a stale name behind (the parent's "1 passed" check would catch it, but
only by failing).

`cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: exit 0.
`cargo test -p leonida-gpu --locked`: 758 passed, 0 failed, 60 ignored.

AI-assisted (Freebuff, Buffy)
The parent took "1 passed" from the child's output, which "11 passed" would
also satisfy; it takes "test result: ok. 1 passed" now, so only a run of the
one named test counts.

`cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: exit 0.
`cargo test -p leonida-gpu --locked`: 758 passed, 0 failed, 60 ignored.

AI-assisted (Freebuff, Buffy)
The 64-bit test's checks held under a signed comparison too (-1 >= -2 is true
and -3 >= -2 false); it now rejects 0x7fff_ffff_ffff_ffff, which only an
unsigned comparison puts below 0xffff_ffff_ffff_fffe. The 32-bit test records a
wait whose reference is 0x134 under a 0xff mask: no value meets it, where a
reference passed through the mask would be met by 0x34. The 0x1000_0134
message now says that the call's mask, not the 32-bit width, drops the bytes
above.

AI-assisted (Freebuff, Buffy)
The third wait in the 32-bit test has a mask (0xff); it is its reference that
is not passed through it, so the local is named for that.

`cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: exit 0.
`cargo test -p leonida-gpu --locked`: 758 passed, 0 failed, 60 ignored.

AI-assisted (Freebuff, Buffy)
Author
Member

Merged by Moon's agent, on Moon's written authorization ("Fusionne toi car on est que deux maintener"). The separate reviewer's verdict was ACCEPT, at head 99fc783296. Tests only, no player-facing change. CHANGELOG.md is not in main yet (#3454).

Merged by Moon's agent, on Moon's written authorization ("Fusionne toi car on est que deux maintener"). The separate reviewer's verdict was ACCEPT, at head 99fc783296. Tests only, no player-facing change. CHANGELOG.md is not in main yet (#3454).
OreoFR referenced this pull request from a commit 2026-12-04 14:57:41 +00:00
Sign in to join this conversation.
No description provided.