Tests bindless::heap_views_* fail intermittently in a full workspace run #2252

Closed
opened 2026-11-26 04:59:55 +00:00 by github-bot · 5 comments
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 08:52 UTC · original

bindless::tests::heap_views_* in victory-gpu fail now and then in a full cargo test --workspace --locked on main, and pass when cargo test -p victory-gpu --lib is run on its own.

What I saw (Windows 11, RX 6950 XT, Rust 1.98.1, main 940d32f): the same assertion failed in 3 of 36 full runs, once on main alone (in bindless::tests::heap_views_are_current) and twice on main plus an unrelated open PR (#2175 and #2187, in bindless::tests::heap_views_follow_writes_through_another_mapping). main alone passed its other 3 full runs, and 6 runs of cargo test -p victory-gpu --lib on one of the failing trees all passed (144 each).

thread 'bindless::tests::heap_views_are_current' panicked at crates\victory-gpu\src\bindless.rs:612:17:
assertion `left == right` failed: round 0, dword 0
  left: 0
 right: 1064

The failing line is the same in both tests, round 0, dword 0: the value read back is 0 where the test expects 1064. I have not found the cause. A guess, not checked: these tests use the host GPU together with the other GPU tests running at the same time in one process.

This is the second test of main that fails like this in full runs: see #1882 (emit::memory_tests::title_memory_is_read_and_written_at_computed_addresses). No game data is involved.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-25 08:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/2252) `bindless::tests::heap_views_*` in `victory-gpu` fail now and then in a full `cargo test --workspace --locked` on `main`, and pass when `cargo test -p victory-gpu --lib` is run on its own. **What I saw** (Windows 11, RX 6950 XT, Rust 1.98.1, `main` `940d32f`): the same assertion failed in 3 of 36 full runs, once on `main` alone (in `bindless::tests::heap_views_are_current`) and twice on `main` plus an unrelated open PR (#2175 and #2187, in `bindless::tests::heap_views_follow_writes_through_another_mapping`). `main` alone passed its other 3 full runs, and 6 runs of `cargo test -p victory-gpu --lib` on one of the failing trees all passed (144 each). ``` thread 'bindless::tests::heap_views_are_current' panicked at crates\victory-gpu\src\bindless.rs:612:17: assertion `left == right` failed: round 0, dword 0 left: 0 right: 1064 ``` The failing line is the same in both tests, round 0, dword 0: the value read back is 0 where the test expects 1064. I have not found the cause. A guess, not checked: these tests use the host GPU together with the other GPU tests running at the same time in one process. This is the second test of `main` that fails like this in full runs: see #1882 (`emit::memory_tests::title_memory_is_read_and_written_at_computed_addresses`). No game data is involved. AI-assisted (Claude Code); no game data.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:59:55 +00:00
Author
Owner

@⁠Ingenioeren on GitHub · 2026-11-25 09:13 UTC · original

Does not reproduce on main 940d32f on an RX 6750 XT (RDNA2): 0 failures in 336 runs of the two tests.

Windows 11, Rust MSVC toolchain, default features.

Experiment Runs heap_views_* failures
cargo test --workspace --locked --no-fail-fast 6 0
victory-gpu lib test binary on its own 150 0
three copies of the victory-gpu lib test binary at the same time (to share the GPU across processes) 60 × 3 0

The only failures in the workspace runs were emit::rect::tests::rectangles_get_their_fourth_corner and emit::tests::elements_sharing_a_row_keep_their_order. They fail every run on this PC because the local dxil.dll rejects them, so they are not related.

Things I read and ruled out (code reading only, not proven):

  • descriptor::sync_heaps cannot rewrite the test's slots, because the test heap is allocated by us and has no written tracker.
  • The diagnostics feature is not on in a workspace test build, since nothing enables it by default. So the workspace build of victory-gpu matches the per-crate one.

A value of 0 at round 0, dword 0 means either the dispatch's write never reached the output's host copy, or src and the texture both read zero (if only one of them read zero, the result would be 64 or 1000, not 0). So I still have no cause.

AI assistance: prepared with Claude Code, reviewed by Ingenioeren.

**@⁠Ingenioeren** on GitHub · 2026-11-25 09:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/2252#issuecomment-7158052895) **Does not reproduce on `main` `940d32f` on an RX 6750 XT (RDNA2): 0 failures in 336 runs of the two tests.** Windows 11, Rust MSVC toolchain, default features. | Experiment | Runs | `heap_views_*` failures | |---|---|---| | `cargo test --workspace --locked --no-fail-fast` | 6 | 0 | | `victory-gpu` lib test binary on its own | 150 | 0 | | three copies of the `victory-gpu` lib test binary at the same time (to share the GPU across processes) | 60 × 3 | 0 | The only failures in the workspace runs were `emit::rect::tests::rectangles_get_their_fourth_corner` and `emit::tests::elements_sharing_a_row_keep_their_order`. They fail every run on this PC because the local `dxil.dll` rejects them, so they are not related. Things I read and ruled out (code reading only, not proven): - `descriptor::sync_heaps` cannot rewrite the test's slots, because the test heap is allocated by us and has no `written` tracker. - The `diagnostics` feature is not on in a workspace test build, since nothing enables it by default. So the workspace build of `victory-gpu` matches the per-crate one. A value of 0 at round 0, dword 0 means either the dispatch's write never reached the output's host copy, or `src` and the texture both read zero (if only one of them read zero, the result would be 64 or 1000, not 0). So I still have no cause. AI assistance: prepared with Claude Code, reviewed by Ingenioeren.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 09:18 UTC · original

I reproduced the reported 0 instead of 1064 on WARP at main 940d32f69b. On the failing runs the bindless heap tracked no viewed buffer ranges, although the title's view records were present. The placed-heap fixture was leaving a stale heap registration behind when it dropped its descriptor memory.

The fix and regression are in d183e7c, opened as #2262. With deterministic address reuse, the same test fails on the base because the new heap receives no descriptor write and passes with the fixture cleanup. Full victory-gpu WARP run after the fix: 146 passed, 0 failed, 2 ignored.

If you use this change or its test, please keep the Git author. If you fold either into your own commit, please add:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted. Synthetic tests only.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 09:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/2252#issuecomment-7158145429) I reproduced the reported 0 instead of 1064 on WARP at main 940d32f69b22265690a0b5a15d6ded572ba33baf. On the failing runs the bindless heap tracked no viewed buffer ranges, although the title's view records were present. The placed-heap fixture was leaving a stale heap registration behind when it dropped its descriptor memory. The fix and regression are in [d183e7c](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/d183e7c9b920f45c06f4c5bed4c24298463f7f12), opened as #2262. With deterministic address reuse, the same test fails on the base because the new heap receives no descriptor write and passes with the fixture cleanup. Full victory-gpu WARP run after the fix: 146 passed, 0 failed, 2 ignored. If you use this change or its test, please keep the Git author. If you fold either into your own commit, please add: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted. Synthetic tests only.
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 09:39 UTC · original

Reproduction attempt on this machine (Windows 10 19045, RX 7800 XT, main 940d32f): 8 runs of cargo test -p victory-gpu --features diagnostics --lib — the bindless tests passed every time. The one failure in each run is the known draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view on a Windows 10 runtime without ID3D12Device10 (#1999), not this.

So I could not reproduce the flake here, and I would rather not commit a serialisation lock that might hide a real ordering bug. Can you add:

  1. the full assertion text (the message after left == right failed: is cut in the issue), and
  2. whether --test-threads=1 avoids it — that separates shared-state interference from a timing bug in execute's upload/copy-back path.

If it is the parallel case, my first suspect is the bindless upload list built in Host::execute: the heap's Viewed ranges are snapshotted there under the submitted lock, so a lock per test would only paper over it. With the message and a failing log I can tell which of the two it is; a VICTORY_LOG=debug run of the full workspace would also show the descriptor sync/upload lines around the bad round.

**@⁠Calvix2k** on GitHub · 2026-11-25 09:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/2252#issuecomment-7158635635) Reproduction attempt on this machine (Windows 10 19045, RX 7800 XT, `main` `940d32f`): 8 runs of `cargo test -p victory-gpu --features diagnostics --lib` — the bindless tests passed every time. The one failure in each run is the known `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` on a Windows 10 runtime without `ID3D12Device10` (#1999), not this. So I could not reproduce the flake here, and I would rather not commit a serialisation lock that might hide a real ordering bug. Can you add: 1. the full assertion text (the message after `left == right failed:` is cut in the issue), and 2. whether `--test-threads=1` avoids it — that separates shared-state interference from a timing bug in `execute`'s upload/copy-back path. If it is the parallel case, my first suspect is the bindless upload list built in `Host::execute`: the heap's `Viewed` ranges are snapshotted there under the `submitted` lock, so a lock per test would only paper over it. With the message and a failing log I can tell which of the two it is; a `VICTORY_LOG=debug` run of the full workspace would also show the descriptor sync/upload lines around the bad round.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 09:55 UTC · original

The full assertion from my failing heap_views_follow_writes_through_another_mapping run was:

assertion left == right failed: round 0, dword 0
  left: 0
 right: 1064

I reran the clean 940d32f GPU test binary with forced WARP and --test-threads=1. All 36 full victory-gpu runs passed (146 passed, 2 ignored each). In the earlier 16-thread WARP runs with observation enabled, the same bindless assertion failed 3 of 63 times. Those three runs showed zero viewed ranges even though the two title-side view records were still present.

The deterministic check in #2262 explains how those ranges can go missing. The placed-heap test left its first heap registered when it released the backing memory. A later heap at the same address took no descriptor writes because the registry still matched the original heap first. Recreating a heap at the same address in the fixture fails before the cleanup and passes with d183e7c. This change releases the fixture handles. The patched binary also passed 85 full 16-thread WARP runs.

If you reuse the fixture or its cleanup, please preserve the Git author. If you fold either into another commit, please add:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted. Synthetic tests only.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 09:55 UTC · [original](https://github.com/Marvisak/VIctory/issues/2252#issuecomment-7158984030) The full assertion from my failing heap_views_follow_writes_through_another_mapping run was: assertion left == right failed: round 0, dword 0 left: 0 right: 1064 I reran the clean 940d32f GPU test binary with forced WARP and --test-threads=1. All 36 full victory-gpu runs passed (146 passed, 2 ignored each). In the earlier 16-thread WARP runs with observation enabled, the same bindless assertion failed 3 of 63 times. Those three runs showed zero viewed ranges even though the two title-side view records were still present. The deterministic check in #2262 explains how those ranges can go missing. The placed-heap test left its first heap registered when it released the backing memory. A later heap at the same address took no descriptor writes because the registry still matched the original heap first. Recreating a heap at the same address in the fixture fails before the cleanup and passes with [d183e7c](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/d183e7c9b920f45c06f4c5bed4c24298463f7f12). This change releases the fixture handles. The patched binary also passed 85 full 16-thread WARP runs. If you reuse the fixture or its cleanup, please preserve the Git author. If you fold either into another commit, please add: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted. Synthetic tests only.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:51 UTC · original

Automated triage for the maintainers.

The mechanism found in the thread is still on main (da82e44): placed_heaps_start_at_the_title_memory in crates/victory-gpu/src/descriptor.rs (tests) creates a heap placed in a local Vec and never releases it. When the Vec's memory is freed, the heap stays registered at that address. A later test heap that gets the same address then misses its descriptor writes, which explains the intermittent 0 vs 1064 in bindless::tests::heap_views_* in full parallel runs. Open PR #2262 releases the fixture's heaps and adds a reuse check.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/2252#issuecomment-7167377088) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T09:55:27Z at=2026-11-25T15:51:31Z --> Automated triage for the maintainers. The mechanism found in the thread is still on main (da82e44): `placed_heaps_start_at_the_title_memory` in `crates/victory-gpu/src/descriptor.rs` (tests) creates a heap placed in a local `Vec` and never releases it. When the `Vec`'s memory is freed, the heap stays registered at that address. A later test heap that gets the same address then misses its descriptor writes, which explains the intermittent `0` vs `1064` in `bindless::tests::heap_views_*` in full parallel runs. Open PR #2262 releases the fixture's heaps and adds a reuse check. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#2252
No description provided.