Game: torch flames vanish and come back while Threaded rendering is on (RTX 4090, nightly-981); Off fixes it #2992
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#2992
Loadingβ¦
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Longshot version and channel
Nightly-981 (
56823e27, main on 2026-12-01). It includes #2863.System
RTX 4090, NVIDIA 621.47, Intel i9-13900K (8 performance and 16 efficiency cores, 32 threads), 32 GB, Windows 11 (build 26200).
Settings
4K output, V-Sync on, NVIDIA DLAA with "DLAA before the bloom" on, HDR Native with the PsychoV35 tone mapper, frame
generation off. Threaded rendering on Auto, which started the render thread and the recorder thread.
What happens
Torch flames appear, disappear and come back, over and over. In the Forest Temple's main room, with all four Poe sisters
beaten, the four coloured flames don't stay lit: a screenshot caught only the blue one burning. The player says torches
they light themselves do the same. A friend on another PC doesn't see it.
Workaround: Debug tab β Threaded rendering β Off (restart). The flames then stay lit.
What we checked
Shown in it: "readbacks read without their wait: the culling camera block (0x3980)", and with the render thread on,
RX_VK_READBACK_EARLY is left off.
player's save and all their settings: the four flames stayed lit in 540 screenshots measured one by one (Threaded
rendering Auto, render and recorder threads on). That included runs with the game held to 4 and to 2 logical
processors (31 fps). The Fire Temple's torches were fine too. Not reproduced.
Reading
A timing race in the threaded replay: the flames draw some frames and not others, the game's own state is right (they
come back), and turning the threads off fixes it. Only some PCs hit it. The shape is like #2079's lock-on arrows (a
particle's record written by the game and put back by the GPU write-back, fixed in #2863), but on another path.
Candidate switches:
RX_VK_NO_WRITEBACK=1,RX_VK_READBACK_LATE=0,RX_VK_OCC_QUERIES=0.Next
RX_VK_ASYNC=0alone (render thread off), thenRX_VK_RECORDER=syncalone (recorder thread off). Asked of the player.attack effects missing, RX 9070 XT, v3.2.0). Both could try Threaded rendering Off.
π€ Generated with Claude Code
Possibly related, for context:
It's the render thread. The player's tests, with Threaded rendering back on Auto and one switch at a time in
longshot_env.txt:RX_VK_ASYNC=0(the render thread off, the recorder thread kept): the flames stay lit.RX_VK_RECORDER=sync(the recorder thread off, the render thread kept): the flames still vanish and come back.So the race is in the replay on the render thread, not in the recorder.
The driver alone doesn't cause it. The RTX 5080 PC was updated to NVIDIA 621.47, the player's version, and run again at the same commit, with the player's save and settings and Threaded rendering on Auto: all four Forest Temple flames were lit in 200 of 200 screenshots. What's left that differs is the player's CPU (an i9-13900K, with performance and efficiency cores) and their RTX 4090.
π€ Generated with Claude Code
Correction to the description and to my comment above. The runs on the RTX 5080 PC did not have all the player's settings, so "not reproduced" and "the driver alone doesn't cause it" don't hold:
V-Sync: the player has it On (fifo, a 3840x2160 swapchain). Every windowed run here was on Auto (mailbox, a 1280x720 or 1920x1080 window). The player's settings file was not compared, so other settings may differ too.
The settings were not tested one at a time. Each was added on top of the last, at the Fire Temple, and the first of those runs had no window.
The logs show how far apart the runs were (from the Forest Temple's load on; three main-room runs here):
the render thread: jobs queued at a presentthe render thread: presents, ms a framelate pages found at the replay (600 takes)"It's the render thread" was too strong.
RX_VK_ASYNC=0also changes the default ofRX_VK_READBACK_EARLY, so it doesn't isolate the render thread.New results from the player, Threaded rendering on Auto, one change at a time (as reported; the logs of these runs haven't been seen, so whether each switch was taken isn't checked):
RX_VK_READBACK_LATE=0RX_VK_OCC_QUERIES=0RX_VK_NO_WRITEBACK=1Best reading, not proven: the write-back is involved. With V-Sync On the render thread spends most of the frame in its presents, the replay falls further behind the game, and the write-back may put older data over what the game wrote meanwhile.
Next: V-Sync Off with Threaded rendering on Auto, from the player; V-Sync On at the same spot, on the RTX 5080 PC.
π€ Generated with Claude Code
V-Sync Off keeps the torches lit for the player, with Threaded rendering on Auto and the write-back on. The flames are as the player reports them; the numbers are from the player's logs, from the Forest Temple's load on:
RX_VK_NO_WRITEBACK=1late pages found at the replay (600 takes)The build, driver, 4K HDR output, 60 Hz screen and Threaded rendering are the same in the three logs.
RX_VK_NO_WRITEBACK=1is in the second log's switches line, so it was taken. It's one run of each.So a replay that falls behind doesn't hide the flames by itself: it's behind in the second run too, and they stay lit. The reading that fits is a replay that V-Sync On holds up, and a write-back that then puts older data over what the game wrote. That overwrite itself hasn't been caught.
Not reproduced on the RTX 5080 PC, and the conditions weren't met there. With V-Sync On (fifo), fullscreen at 1920x1080 and Windows at 60 Hz, the present didn't wait: a frame was shown 1.6 ms after its present (16 ms in the player's log), the game ran at 90 fps with the cap at 90, and there were 3 jobs queued and 0 late pages. Why it doesn't wait there isn't known. Earlier at 60 Hz, as windows were being switched, three readings in a row had 1580, 3025 and 2960 late pages; the flames weren't measured then.
Workarounds: V-Sync Off, or Threaded rendering Off.
Next, for the player: with V-Sync On and Threaded rendering on Auto,
RX_VK_LATE_FIX=0,RX_VK_LATE_AT_REPLAY=0andRX_VK_WB_DIFF=0, one at a time, with each run's log.π€ Generated with Claude Code
The flames are lost through the late-at-replay step. The player's next three runs, V-Sync On at 60 Hz with Threaded rendering on Auto, one switch each. Each switch is in its log's switches line; the flames are as the player reports them, one run of each:
RX_VK_LATE_FIX=0RX_VK_LATE_AT_REPLAY=0RX_VK_WB_DIFF=0RX_VK_NO_WRITEBACK=1, with spells of normal animationlate pages found at the replay (600 takes)The replay is behind in all three, so the backlog isn't what differs.
That step is
capture_late_at_replayingpu/vk/vk_memory.cppwithgpu/vk/late_replay.h, from #1339 (in v3.0.0 and later, and in main at56823e27). It decides, for a page both the CPU and the GPU wrote, whose words the mirror gets.The reading that fits, not proven: its own comment says that when the CPU wrote a word before submission k was done, the word takes k's value. With V-Sync On holding the replay several submissions behind the game, a word the game writes once (as #2079's particle records were) could lose to an older submission's value, and the flame with it. Without the step the capture's older CPU words go over the GPU's newer ones, which would be the animations jumping back. This replaces the reading in my last comments, of the write-back alone putting older data back. The word that is lost hasn't been found.
RX_VK_LATE_AT_REPLAY=0isn't a fix: it trades one fault for the other. The workarounds stay V-Sync Off or Threaded rendering Off.π€ Generated with Claude Code
V-Sync Auto keeps the flames normal for the player, and the memory check shows newer values set back with
RX_VK_LATE_AT_REPLAY=0. Four more runs from the player, Threaded rendering on Auto, a 60 Hz screen; the flames as the player reports them, one run of each, all four logs checked:late pages found at the replay (600 takes)RX_VK_MEM_CHECK=1RX_VK_MEM_CHECK=1andRX_VK_LATE_AT_REPLAY=0Reflex: online after it, so it looks turned off from there.sync_over_gpu12356 replaced of 122428 candidates, 118395 of them by the pathmirror write-back not late. In the logged cases three pages come up again, each set back about a step: the mirror's 3cd5d024, then 3cf9e1f5 replaced by 3cd5cf15 (page 0x10465a4000 +0xe80); bd5efff5, then bd6e6cd6 replaced by exactly bd5efff5 (0x104687a000 +0xa80); 3f8d517e, then 3f8d38b1 replaced by exactly 3f8d517e (0x1046632000 +0xf80). The check can't tell a loss from the CPU's own write of the same value, and the summary has none on a page no CPU write made dirty. Among the writers named for candidates in that pool: fa61fd36abc192cf, 755a777ada52677d, 447ebb51fd89e8df. Whether these pages are the flames' isn't known.sync_over_gpureplaced. The check doesn't look for the opposite, a CPU write lost to the GPU's value, so it doesn't show what makes the flames vanish.This fits the two ways the late-at-replay step can go wrong, and doesn't prove either one for the flames. One correction: my last comment's first line, "The flames are lost through the late-at-replay step", is a lead, not a finding.
Workarounds: V-Sync Auto or Off, or Threaded rendering Off.
π€ Generated with Claude Code