Descriptor tests: a slot copied as bytes is tried again when another round has its page #481

Closed
github-bot wants to merge 1 commit from github-bot/gh-481 into main AGit
Owner

@⁠erdemcisse on GitHub · 2026-12-02 16:05 UTC · original
ci-descriptor-sync-retry → main · +26 −11 · 1 files · 1 commits · closed without merging

cargo test --workspace went red in CI run 46920076425, on a pull request that changes only launcher/Launcher.cs:

panicked at crates\victory-gpu\src\descriptor.rs:2736:
assertion failed: host.made(5)
test result: FAILED. 619 passed; 1 failed; 38 ignored

The same commit passes the whole workspace here, and this test on its own passed 60 times of 60. It is order-dependent, not a fault of the change that run was testing.

Why a round can miss it

The tests of one binary run on threads of one process, and sync_heaps() walks every heap registered (crates/victory-gpu/src/descriptor.rs:574). A round takes a changed page for itself before it reads it (crate::watch::Tracked::take, crates/victory-gpu/src/watch.rs:1474): after that the page counts as taken. Another test's round can take this heap's page between the copy and this test's own round, and be elsewhere in its pass when the copy lands, so this test's round then finds nothing to read and makes no slot.

The file already says so, for cleared_before_made (crates/victory-gpu/src/descriptor.rs:2785-2787):

Other tests' submissions sync every heap, this one too, and a round of theirs may have taken its page and still be at it: tried again.

That test retries. records_copied_as_bytes_are_made_at_the_next_sync did not.

Reproduced

A scratch test that creates 200 such heaps while a second thread calls sync_heaps() in a loop left slot 5 unmade by its own round 3 of 200 times, and 2 of 200 in a second run. Two further rounds then made it: the page stays dirty and a later round finds it, so this is timing, not a lost write.

Change

The copy and the round are tried again, 2 ms apart, at most 100 times — the shape cleared_before_made already uses (crates/victory-gpu/src/descriptor.rs:2787-2800). The first attempt keeps assert!(!host.made(5)), so "a record copied as bytes waits for a round" is still asserted before any sync; later attempts write the same 16 bytes again.

Tested here

check result
the test alone, 100 runs 0 failed
the whole victory-gpu test binary, 5 runs 619 passed each
the same 200-heap scratch loop with this shape, concurrent rounds 0 of 200 failed (202 rounds: two needed a second)
cargo clippy -p victory-gpu --all-targets -- -D warnings clean

Test only, one file, no product code changes.

**@⁠erdemcisse** on GitHub · 2026-12-02 16:05 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/481) `ci-descriptor-sync-retry` → `main` · +26 −11 · 1 files · 1 commits · closed without merging `cargo test --workspace` went red in CI run [46920076425](https://github.com/readmet3xt-lab/foxhound/actions/runs/46920076425), on a pull request that changes only `launcher/Launcher.cs`: ``` panicked at crates\victory-gpu\src\descriptor.rs:2736: assertion failed: host.made(5) test result: FAILED. 619 passed; 1 failed; 38 ignored ``` The same commit passes the whole workspace here, and this test on its own passed 60 times of 60. It is order-dependent, not a fault of the change that run was testing. ## Why a round can miss it The tests of one binary run on threads of one process, and `sync_heaps()` walks every heap registered (`crates/victory-gpu/src/descriptor.rs:574`). A round takes a changed page for itself before it reads it (`crate::watch::Tracked::take`, `crates/victory-gpu/src/watch.rs:1474`): after that the page counts as taken. Another test's round can take this heap's page between the copy and this test's own round, and be elsewhere in its pass when the copy lands, so this test's round then finds nothing to read and makes no slot. The file already says so, for `cleared_before_made` (`crates/victory-gpu/src/descriptor.rs:2785-2787`): > Other tests' submissions sync every heap, this one too, and a round of theirs may have taken its page and still be at it: tried again. That test retries. `records_copied_as_bytes_are_made_at_the_next_sync` did not. ## Reproduced A scratch test that creates 200 such heaps while a second thread calls `sync_heaps()` in a loop left slot 5 unmade by its own round **3 of 200** times, and **2 of 200** in a second run. Two further rounds then made it: the page stays dirty and a later round finds it, so this is timing, not a lost write. ## Change The copy and the round are tried again, 2 ms apart, at most 100 times — the shape `cleared_before_made` already uses (`crates/victory-gpu/src/descriptor.rs:2787-2800`). The first attempt keeps `assert!(!host.made(5))`, so "a record copied as bytes waits for a round" is still asserted before any sync; later attempts write the same 16 bytes again. ## Tested here | check | result | |---|---| | the test alone, 100 runs | 0 failed | | the whole `victory-gpu` test binary, 5 runs | 619 passed each | | the same 200-heap scratch loop with this shape, concurrent rounds | 0 of 200 failed (202 rounds: two needed a second) | | `cargo clippy -p victory-gpu --all-targets -- -D warnings` | clean | Test only, one file, no product code changes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 16:16:27 +00:00
github-bot closed this pull request 2026-12-03 18:16:57 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.