Tests: views off their elements are placed from a window's start (flaky in one run in twenty) #785

Merged
kibagami-nc merged 1 commit from upstream-pr/785 into main 2026-11-29 08:16:58 +00:00
kibagami-nc commented 2026-11-28 05:52:36 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T05:52:36Z.


descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes fails on main in about one run in twenty. Its structured view gets a 4 MiB buffer instead of a copy of its own bytes:

panicked at crates\victory-gpu\src\descriptor\host.rs:6212:13:
assertion `left == right` failed
  left: 4194304
 right: 2048

Here it failed 4 times in 79 runs of the test alone. It also failed once in a whole cargo test --workspace --locked run on 63b902f.

Why

  • The test's memory is loose memory (a vector), so its host copy is the 4 MiB window over it (crate::shadow). Whether a view is "off its elements" depends on where it lies in that copy (view_home, then off_elements).
  • The test placed its views from the first page start inside a 64 KiB vector. The 456-byte structured view at +8 then lay at k * 4096 + 8 in its window, where k is the page's index in the window.
  • That offset is a multiple of 456 whenever k ≡ 1 (mod 57). In those runs the view is on its elements, so it takes the window, which is right for the code but not what the test expects.
  • k depends on where the allocator put the vector, so the test failed at random.

The change

  • The memory is now 8 MiB, and the views are placed from a 4 MiB line. Each view then lies exactly its offset into its window: +8 is off its elements for both views, and +16 and +32 are on them, as the test means.
  • A line aligned to 4 MiB is aligned on any smaller window grid too (VICTORY_WINDOW_KB).
  • Only the test changes.

Tests

run main this branch
the test alone 4 failures in 79 runs 0 failures in 60 runs
cargo test -p victory-gpu --lib --locked failed once in a workspace run 4 of 4 runs pass (453 passed)

Clippy (default and --all-features) shows nothing in the changed file. Main's own lints are in #665.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5537227418 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/785). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-28T05:52:36Z. --- `descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes` fails on `main` in about one run in twenty. Its structured view gets a 4 MiB buffer instead of a copy of its own bytes: ``` panicked at crates\victory-gpu\src\descriptor\host.rs:6212:13: assertion `left == right` failed left: 4194304 right: 2048 ``` Here it failed 4 times in 79 runs of the test alone. It also failed once in a whole `cargo test --workspace --locked` run on `63b902f`. ## Why - The test's memory is loose memory (a vector), so its host copy is the 4 MiB window over it (`crate::shadow`). Whether a view is "off its elements" depends on where it lies in that copy (`view_home`, then `off_elements`). - The test placed its views from the first page start inside a 64 KiB vector. The 456-byte structured view at `+8` then lay at `k * 4096 + 8` in its window, where `k` is the page's index in the window. - That offset is a multiple of 456 whenever `k ≡ 1 (mod 57)`. In those runs the view is on its elements, so it takes the window, which is right for the code but not what the test expects. - `k` depends on where the allocator put the vector, so the test failed at random. ## The change - The memory is now 8 MiB, and the views are placed from a 4 MiB line. Each view then lies exactly its offset into its window: `+8` is off its elements for both views, and `+16` and `+32` are on them, as the test means. - A line aligned to 4 MiB is aligned on any smaller window grid too (`VICTORY_WINDOW_KB`). - Only the test changes. ## Tests | run | `main` | this branch | |---|---|---| | the test alone | 4 failures in 79 runs | 0 failures in 60 runs | | `cargo test -p victory-gpu --lib --locked` | failed once in a workspace run | 4 of 4 runs pass (453 passed) | Clippy (default and `--all-features`) shows nothing in the changed file. Main's own lints are in #665.
Dukestar69 commented 2026-11-28 07:13:13 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T07:13:13Z.

Review: APPROVED


Tested locally merged onto main (63b902f).

  • Merge & Policy: Clean merge; cargo xtask policy passed (294 files ok).
  • Tests (RTX 5090): cargo test -p victory-gpu --lib descriptor:: passed (62 passed; 0 failed, including views_off_their_elements_are_told and views_off_their_elements_get_a_copy_of_their_bytes) with 0 compiler warnings.

Clean test placement fix anchoring the unaligned view from the window start. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6096435057 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/785#pullrequestreview-6096435057). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-28T07:13:13Z. **Review:** APPROVED --- Tested locally merged onto `main` (`63b902f`). - **Merge & Policy**: Clean merge; `cargo xtask policy` passed (`294 files ok`). - **Tests (RTX 5090)**: `cargo test -p victory-gpu --lib descriptor::` passed (`62 passed; 0 failed`, including `views_off_their_elements_are_told` and `views_off_their_elements_get_a_copy_of_their_bytes`) with 0 compiler warnings. Clean test placement fix anchoring the unaligned view from the window start. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!785
No description provided.