Let the sRGB view test wait out slots held back for new textures #456

Closed
github-bot wants to merge 1 commit from github-bot/gh-456 into review/local-integration-20261129 AGit
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 19:16 UTC · original
Kal0s-design:fix/srgb-test-waits-out-new-textures-later → review/local-integration-20261129 · +23 −0 · 2 files · 1 commits · closed without merging

Against #439's branch (review/local-integration-20261129), where the test was added (a898e2e, with the deferral reporting from f90c37e).

What fails. resource::tests::srgb_and_linear_views_of_one_texture_read_their_own_curve reads 0 through one or all three of its views in about 2 of 5 runs of the parallel victory-gpu suite here. It never fails run alone, and never with --test-threads=1 (0 of 8 full-suite runs). Two shapes of the failure, both with deferred=false:

  • texture 28, views 29/28/none: read [0.0, 0.0, 0.0]
  • read [0.0, 0.5019608, 0.5019608] (only the sRGB view)

How it was narrowed. The test ran together with one other module at a time, 12 runs each: only shadow:: (5/12) and resource:: (7/12) made it fail. Inside shadow:: it came down to a single test: paired with shadow::loose_allocation_tests::loose_reselects_concurrent_wider_tail_or_holder_and_gpu_readback_sees_live_bytes, it failed 8 of 12, and 0 of 12 with each of the other four loose_allocation_tests.

Cause. Probes in the test showed:

  • A sentinel word the shader stores comes back, so the dispatch and readback run.
  • The texture's memory holds the bytes, upload_from records the upload (fresh staging, dirty), and the refresh at submission reads it as committed.
  • The views that do read give the right values.

So the texture is on the card; what reads 0 is the slot. A texture made while a submission begun before it may still run is shown only once that submission has finished (show_new_later). Until then its slots hold the neutral texture, and the runtime flips them at its next pass (HostHeap::texture_slots_flip). In the parallel suite the other test's GPU readback is such a submission, and the test never reaches a pass. Confirmed with the switch on the pair: 11 of 30 failed by default, 0 of 30 with VICTORY_SHOW_NEW_LATER=0.

Change (test only). Before dispatching, the test does what that pass does: while a slot of its heap is held back, heap.texture_slots_flip(), with a 10 s deadline that fails with a message naming the texture. HostHeap::holds_back is a #[cfg(test)] helper over FLIPS. There's no retry and no sleep, and the assertions are unchanged; the runtime's behaviour is untouched.

Checked here:

  • The pair failed 0 of 30 after the change, against 11 of 30 before.
  • A probe on the wait showed a slot held back in 10 of 20 paired runs, and all of them passed.
  • The full parallel suite had 0 failing runs in 10, against about 2 in 5 before.
  • cargo test -p victory-gpu --all-features -- --test-threads=1 passes (624). cargo check --profile diag --all-features and cargo xtask policy pass.
  • Clippy reports nothing in victory-gpu. The workspace clippy run still fails on the base's own undocumented_unsafe_blocks and water_tile_slots items, which #442 fixes.

Whether CI's runner executes this test at all (it needs fully typed format casting) I haven't checked.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-11-29 19:16 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/456) `Kal0s-design:fix/srgb-test-waits-out-new-textures-later` → `review/local-integration-20261129` · +23 −0 · 2 files · 1 commits · closed without merging Against #439's branch (`review/local-integration-20261129`), where the test was added (a898e2e, with the deferral reporting from f90c37e). **What fails.** `resource::tests::srgb_and_linear_views_of_one_texture_read_their_own_curve` reads 0 through one or all three of its views in about 2 of 5 runs of the parallel `victory-gpu` suite here. It never fails run alone, and never with `--test-threads=1` (0 of 8 full-suite runs). Two shapes of the failure, both with `deferred=false`: - `texture 28, views 29/28/none: read [0.0, 0.0, 0.0]` - `read [0.0, 0.5019608, 0.5019608]` (only the sRGB view) **How it was narrowed.** The test ran together with one other module at a time, 12 runs each: only `shadow::` (5/12) and `resource::` (7/12) made it fail. Inside `shadow::` it came down to a single test: paired with `shadow::loose_allocation_tests::loose_reselects_concurrent_wider_tail_or_holder_and_gpu_readback_sees_live_bytes`, it failed 8 of 12, and 0 of 12 with each of the other four `loose_allocation_tests`. **Cause.** Probes in the test showed: - A sentinel word the shader stores comes back, so the dispatch and readback run. - The texture's memory holds the bytes, `upload_from` records the upload (fresh staging, `dirty`), and the refresh at submission reads it as committed. - The views that do read give the right values. So the texture is on the card; what reads 0 is the slot. A texture made while a submission begun before it may still run is shown only once that submission has finished (`show_new_later`). Until then its slots hold the neutral texture, and the runtime flips them at its next pass (`HostHeap::texture_slots_flip`). In the parallel suite the other test's GPU readback is such a submission, and the test never reaches a pass. Confirmed with the switch on the pair: 11 of 30 failed by default, 0 of 30 with `VICTORY_SHOW_NEW_LATER=0`. **Change (test only).** Before dispatching, the test does what that pass does: while a slot of its heap is held back, `heap.texture_slots_flip()`, with a 10 s deadline that fails with a message naming the texture. `HostHeap::holds_back` is a `#[cfg(test)]` helper over `FLIPS`. There's no retry and no sleep, and the assertions are unchanged; the runtime's behaviour is untouched. **Checked here:** - The pair failed 0 of 30 after the change, against 11 of 30 before. - A probe on the wait showed a slot held back in 10 of 20 paired runs, and all of them passed. - The full parallel suite had 0 failing runs in 10, against about 2 in 5 before. - `cargo test -p victory-gpu --all-features -- --test-threads=1` passes (624). `cargo check --profile diag --all-features` and `cargo xtask policy` pass. - Clippy reports nothing in `victory-gpu`. The workspace clippy run still fails on the base's own `undocumented_unsafe_blocks` and `water_tile_slots` items, which #442 fixes. Whether CI's runner executes this test at all (it needs fully typed format casting) I haven't checked. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
srgb_and_linear_views_of_one_texture_read_their_own_curve read 0 through
one or all of its views in about 2 of 5 runs of the parallel
victory-gpu suite here, and never alone or with --test-threads=1. Paired
with shadow::loose_allocation_tests::loose_reselects_concurrent_wider_
tail_or_holder_and_gpu_readback_sees_live_bytes it failed 11 of 30 runs;
with VICTORY_SHOW_NEW_LATER=0, 0 of 30.

The texture is uploaded right (a sentinel the shader stores comes back,
and the views that do read give the right values): its slots show the
neutral texture instead. A texture made while a submission begun before
it may still run (here the other test's readback) is shown only once
that submission has finished (show_new_later); the runtime flips the
slots at its next pass, and the test never got to one.

The test now does what that pass does before it dispatches: while a slot
of its heap is held back, texture_slots_flip, with a 10 s deadline. A
slot was held back in 10 of 20 paired runs, and every run passed. After
the change the pair failed 0 of 30, the full suite 0 of 10 runs.

HostHeap::holds_back is test-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 19:16:30 +00:00
github-bot closed this pull request 2026-11-30 17:08:28 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:05 UTC · original

main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:05 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/456#issuecomment-7285706876) `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

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