App: VICTORY_NO_WATCHDOG=1 pauses the title's own hang watchdog (#3624) #3856
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3856"
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?
Imported from Marvisak/VIctory. Originally posted by MannA-001 on 2026-11-29T18:33:01Z.
Implements #3624's "feed the heartbeat" option: a switch that keeps the title's own hang watchdog from ending a slow run, found by its pattern in the code.
Why
Grand Theft Auto VI runs a thread that counts down 30 s whenever its main loop has not ticked, then writes to address 0 on purpose (
+0x23cf683, from+0x2215c35on Series 1.0.2.1). Any slow phase triggers it: pipelines made on a cold cache, a long load, a slow card. Many crash reports are this watchdog rather than a fault (#3603, #2477, #1464 and others). Today the only way past it isVICTORY_POKE, which needs a diagnostics build and the address for the title build.How the watchdog works (Series 1.0.2.1, function
+0x2215a60)Each one-second round reads three bytes next to the heartbeat (
0x71b6338):0x71b6340, the quit flag: when set, the thread returns.0x71b6331, a one-shot reset: when set, the round stores a fresh heartbeat, restarts the countdown, and clears the byte.0x71b6330, a pause flag: while bit 0 is set, every round stores a fresh heartbeat and restarts the countdown. The watchdog never clears it. The title sets it itself (+0x2214a90), its tick writes it every frame (+0x22159df), and its shutdown clears it next to setting the quit flag (+0x22161b4).Change
New
apps/victory/src/watchdog.rs, called fromrunbefore the title starts:pause_flag(text, pdata, writable)finds the watchdog: the one function (by its.pdataentry) holding bothmov ebp, 30andmov dword ptr [0], imm32. In it, the pause flag is the writable byte loaded withmov r8, byte ptr [rip+disp32], tested withtest r8, 1and branched on withje, where the set path restarts the countdown within 16 bytes and the function never clears it (mov byte ptr [rip+disp32], 0). That rules out the quit flag (jne) and the one-shot reset byte (cleared). If no function or byte matches, or more than one does, nothing is written.pause(whenVICTORY_NO_WATCHDOGis on, in every build) keeps bit 0 of that byte set twice a second and prints which byte it used, or that no watchdog was found. When the title is running, its own tick takes the byte over every frame. When it stalls, the watchdog keeps re-arming instead of counting down.crashes.lognote. A real hang then hangs instead of ending, so the switch is off by default.The first version set the quit flag. cobrajet302gt's run showed that the title then asserts 10 s into boot (
int3at+0x31f50): it checks that the watchdog thread is alive. Pausing keeps the thread alive.Verification
victory-image-b99f876b74d4a77f): it findstitle+0x71b6330in 35 ms. The watchdog function0x2215a60is the only match.--console series-s, cold cache): the bannertitle watchdog paused (its pause flag at title+0x71b6330)is printed, and the run passesXUserAddAsync: the offline local user, where the quit-flag version stopped, then streams story data at 30 fps for over two minutes, with no exception.cargo test -p victory --bin victory: 16 passed.cargo clippy -p victory --all-targets -- -D warnings, with and withoutdiagnostics: clean.AI use: Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by cobrajet302gt on 2026-11-29T20:46:44Z.
Field report — first run of
VICTORY_NO_WATCHDOG=1(cherry-picked #3856 @e4213f7onto venue trunk + #189/#3714 stack). Windows host, Wine 11 + rbtree wineserver, NVIDIA RTX 5080, Linux/Wine (Wine on NVIDIA), imageb99f876b74d4a77f, title 930.048.020-vb_sub_story, console mode series-s.title watchdog off (its quit flag at title+0x71b6340)(=0x1471b6340less image base, same byte as theVICTORY_POKE=71b6340:1workaround).0x80000003atimage+0x31f50(first-chance + unhandled; nothing else changed). Decoding the converted image around that RVA: poll a global counter at0x1477ae4c8(sentinel0xFFFFFFFF) against a TLS-table expected value, wait-helper call,int3on failure — a "subsystem never reported" style assert — and it fires ~0.5 s after the host logsXUserAddAsync: the offline local user options=1.+0x31f50, boots normally to the front end (~4× further). So the stop is attributable to the quit path itself, plausibly the title supervising its own watchdog thread returning.Reading: quitting the watchdog thread may trip a liveness interlock on this build; #3624's feed-the-heartbeat option (refresh
0x1471b6338while the host is legitimately busy, thread stays alive) looks like the safer shape. Repro: any diag build with the env var; happy to retest variants (e.g. POKE-once at thread start vs 2 Hz writes).Imported from Marvisak/VIctory. Originally posted by MannA-001 on 2026-11-30T09:39:34Z.
@cobrajet302gt Thanks, that run was the right catch. The quit path does trip the title's check that its watchdog thread is alive.
8e4be78now pauses the watchdog instead of stopping it. Each round of the watchdog reads three bytes next to the heartbeat.0x71b6340is the quit flag.0x71b6331is a one-shot reset that the watchdog clears after use.0x71b6330is a pause flag: while bit 0 is set, every round takes a fresh heartbeat and restarts the countdown, and the thread keeps running. The title uses that one itself (it sets it at+0x2214a90, and its tick writes it every frame at+0x22159df). The switch now finds that byte by its pattern (jeon bit 0, the set path restarts the countdown, the watchdog never clears it) and keeps it set. So this is your feed-the-heartbeat shape, done through the title's own mechanism.Here, on a release build of the branch (Windows 11, RX 7800 XT, Series S, cold cache):
title watchdog paused (its pause flag at title+0x71b6330), then the run passesXUserAddAsync: the offline local userand streams story data at 30 fps for over two minutes, with no+0x31f50. A retest on your Wine/RTX 5080 stack would be very welcome, since that is where the first version failed.Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-30T10:40:33Z.
Independent verification (AI-assisted: Hy4 flash) — Windows, rustc 1.100.0 (MSVC), source + synthetic inputs only, no game data.
PR #3856 (4 files, +237/-0,
App: VICTORY_NO_WATCHDOG=1 pauses the title's own hang watchdog (#3624)) is OPEN, non-draft, MERGEABLE/CLEAN, zero formal APPROVED reviews, no prior comment from me.Checked in a dedicated worktree
D:\Victory-Contrib\pr-3856-watchwith its ownCARGO_TARGET_DIR=D:\Victory-Contrib\target-3856(never shared).63bcca43c6a00a758510398fa43096ce7e4f7df0:git grep -F <test> <base> -- apps/victory/src/watchdog.rs→ no match for either test (both new).git diff --check <base>..HEAD→ exit 0, clean.cargo test --locked -p victory --bin victory -- watchdog::tests::the_watchdogs_pause_flag_is_found_in_its_code --exact --test-threads=1 --quiet→1 passed; 0 failed; 15 filtered out, exit 0.cargo test --locked -p victory --bin victory -- watchdog::tests::no_countdown_no_watchdog --exact --test-threads=1 --quiet→1 passed; 0 failed; 15 filtered out, exit 0.GPU/driver: N/A — both tests scan synthetic byte buffers for the pause flag, no device or title required.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.