Repository navigation
fix(gpu): keep a flight's undeclared shader writes on pages the title writes meanwhile - #592
Merged
pragyaangaur merged 1 commit intoNov 28, 2026
Conversation
… writes meanwhile With VICTORY_FLIGHT1=1 the first indoor area after the opening renders much darker (pragyaangaur#447: median luma 13/255 against 39 without the switch). Shaders that write through a heap's unordered views (the bindless path) or through title-memory programs declare nothing. Their writes are marked in the write-mark bitmap and copied back by the pages marked (copy_back_marked), but those pages were never armed. So a title write to one before the copy-back saved nothing, and the copy-back kept the title's page whole and dropped the shader's bytes there. Waited for, the submitting thread cannot write meanwhile. A flight lets it go on, and it writes the next frame's data into pages the GPU writes too (on the console both land, byte by byte), so GPU-written results are lost. Before a flight is given to the host GPU, the unordered views of its heaps and the copies its title-memory programs' page tables name are now armed (Shadow::arm_undeclared). The first title write to such a page during the flight saves the page's bytes from before, and the copy-back merges both writers' bytes, as for a declared marked write. Once the flight has landed they are disarmed, unless a list still declares writes there. Only the Flight-1 path changes. The test a_heap_view_write_and_a_title_write_on_one_page_during_a_flight_both_land makes a heap-view write and a title write on one page while the flight is held in the air (a test gate: the host queue waits on a fence of the test's). It fails without the fix (the shader's dword comes back as the old value) and passes with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 27, 2026
Nick233x
pushed a commit
to Nick233x/VIctory-macOS
that referenced
this pull request
Nov 28, 2026
main's pragyaangaur#592 keeps a flight's undeclared shader writes armed until it lands (InFlight.armed, disarmed at landing): kept, beside the prep-ahead probe's landing record. flight.rs imports host's list Step as ListStep, apart from its own Step of flight times. host re-exports flight's Gate (main) and probe_marked (here). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch:
fork fix/flight1-unarmed-writes(one commit on main d1609d9).What. Before a Flight-1 flight (
VICTORY_FLIGHT1=1, #447) is given to the host GPU, the pages its shaders may write with no list declaring them are armed (Shadow::arm_undeclared):The first title write to such a page during the flight then saves the page's bytes from before, and the copy-back (
copy_back_marked) merges both writers' bytes, as it already does for a declared marked write (Shadow::writing). After the landing the copies are disarmed again, unless a list still declares writes there. Only the Flight-1 path changes; withoutVICTORY_FLIGHT1nothing is armed.Why. On #447, earpjonathan reported that
VICTORY_FLIGHT1=1alone makes the first indoor area after the opening much darker: median luma 13/255 against 39 without the switch.Shaders that write through a heap's unordered views, or through title-memory programs, declare nothing. Their writes are marked in the write-mark bitmap and go back by the pages marked, but those pages were never armed. So a title write to one before the copy-back saved nothing. The copy-back then kept the title's page whole and dropped the shader's bytes on it (counted as
MarkedKept).Waited for, as without the switch, the submitting thread cannot write meanwhile. A flight lets it go on, and the title writes the next frame's data into pages the GPU writes too. On the console both land, byte by byte, because the GPU writes title memory itself. Here the GPU's results on those pages were lost: luminance, for one, which matches the darker picture.
Tests
draw::tests::flight::a_heap_view_write_and_a_title_write_on_one_page_during_a_flight_both_land.host::flight::Gate, test-only, with a 2 s watchdog).flight,marked,write_marks,copy_backfilters): 23 passed, 0 failed.cargo test --workspace: passed. gnullvm clippy--workspace --all-targets -D warnings, with and without--all-features: clean.cargo xtask policy: ok.In game. Not measured on this branch. On our own build (with more changes), the Flight-1 arm was not darker than the arm without it in the first cell. The loss needs the title to write such a page while the flight is in the air, so it depends on the scene and on timing. A re-test in the scene of the report would confirm it. With a diagnostics build,
MarkedKeptin the copy report should drop to the level of a run withoutVICTORY_FLIGHT1.🤖 Generated with Claude Code