Shader: a meet in a block that has already branched keeps that branch; keep GTA VI's 30 s watchdog from ending the run #84
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/DoubleGhosty--cool_fox!84
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-84"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@maridogolpeador on GitHub · 2026-11-27 14:08 UTC · original
maridogolpeador:fix/gta6-meet-in-closed-block-and-watchdog→main· +261 −24 · 11 files · 3 commits · openTwo fixes that took Grand Theft Auto VI from a black screen and a crash to the world on my machine: a shader translator bug, and the title's own hang watchdog.
1. A meet in a block that has already branched (the "use of a void value" panic)
Symptom:
panicked at crates\victory-shader\src\emit\bitcode.rs:872:21: use of a void value, thenhost pipeline build panicked shaders=[compute 02384a60fda6f2d0],a dispatch without a host pipeline dropped, and the title's write to 0 at+0x23cf683.Cause: a lane mask defined in an earlier block and first read as a number later is balloted and exchanged where it was defined. With half meets (a wave64 program on 32-lane host waves) that exchange meets in a block whose branch is already there: the entry, or an earlier block's tail.
half_meet_atgave that block the meet'sCondBrin place of its own branch, so everything the old branch led to became unreachable while its values were still read.VICTORY_OPT_CHECK(2nd commit) showed it:after lowering: ... reads inst 181 in block 5 reached=false; the entry block'sBr(3)was replaced by the meet'sCondBr.cb1468drefuses these programs (a deferred exchange needs a per-wave meet in a closed block). This PR translates them instead:half_meet_atmeets in the block that now holds what is aimed at the closed one, takes its branch off first and puts it on the meet's continuation, and leaves the lowering cursor where it was.Module::terminatefollows a meet's redirect, aspushdoes.Module::settle_meets: a join's incoming from a closed block comes from its continuation.writeleaves out a phi's incoming from a block it does not write; the void-value panic names the instruction, its block and liveness (instead of 1bd5e1a'sfuncs - 1stand-in, which writes wrong DXIL silently).TRANSLATOR_VERSION2 → 4: translations change (and the upstream changes since 2 had not bumped it).The upstream test
a_deferred_ballot_in_a_wave_only_predecessor_is_refusedbecomes..._meets_there: the same program now translates (and is validated when the validator is present).2. The title's 30 s watchdog
The write to 0 at
+0x23cf683(the crash in #39) is deliberate: a watchdog thread (title+0x2215a60) sleeps 1 s, checks the main loop's tick (title+0x71b6338), and after 30 checks without a change decodes a message and writes to address 0. While the first frames wait for their compute pipelines (2a1965f) the loop stalls past 30 s. The watchdog starts its count over on every pass while bit 0 oftitle+0x71b6330is set.VICTORY_POKE(made for exactly this) was only built withdiagnostics; it is now in every build (it does nothing unless set), andPlay-VIctory*.cmdsetVICTORY_POKE=71b6330:1unless already set.Tested on
cargo build --release --locked -p victory(MSVC, Rust 1.98.1), launched withPlay-VIctory.cmdcargo test -p victory-shader --lib: 307 passed, 0 failed.victory shadersover the title: 25,665 in the cache, 320 do not translate (upstream's refusals), 0 panics; before, the run panicked.Play-VIctory-AMD.cmdonly gets the sameVICTORY_POKEline), Linux/Proton.🤖 Generated with Claude Code
The title's watchdog thread (title+0x2215a60) checks once a second that the main loop's tick (title+0x71b6338) moved, and after 30 checks without it ends the title on purpose: it decodes a message and writes to address 0 at +0x23cf683 ("write 0x0: nothing mapped there", the crash in #39). While the first frames wait for their compute pipelines (2a1965f) the loop can stall past 30 s. The watchdog starts its count over on every pass while bit 0 of title+0x71b6330 is set. VICTORY_POKE (run.rs) was only built with `diagnostics`; it is now in every build (it does nothing unless set), and Play-VIctory*.cmd set VICTORY_POKE=71b6330:1 unless it is set already. Co-Authored-By: Claude Opus 5.5 <[email protected]>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.