killflash v3: the one-frame tree blink fixed at its cause, with no waiting (replaces #42) #179
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/ReTerryDavis--ReVIctory!179
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-178"
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?
@PillowFullOfBricks on GitHub · 2026-12-05 21:27 UTC · original
PillowFullOfBricks:table-writes→main· +230 −3 · 6 files · 1 commits · merged 2026-12-06 00:38 UTCkillflash v3: the one-frame tree blink fixed at its cause, with no waiting (replaces #43)
With thin lists on, trees, bushes and props could vanish for a single frame every few seconds. #43 ("killflash v2") hid that by making lists wait for each other. It worked, but the waiting was paid for on the submit thread: more submit time every frame, and a floor under frame time as soon as the processor is the limit. That is why it was kept off by default.
This change removes the cause instead. Nothing waits, nothing is ordered, and submit time is the same with it on and off. It is on by default. #43 is closed as obsolete.
What was wrong
The title keeps a small table of descriptors for each frame and rewrites one buffer view in it every frame from a worker thread. Most of the time that write lands in the first millisecond or two of the frame. Now and then the worker runs late and the write lands about 10 ms in.
With thin lists, draws are translated while the title is still recording the frame. When the title writes a buffer view into a table slot, the host slot is deliberately left empty, to be made by the next draw that reads it. That is fine as long as a draw still comes. When the write is late, every draw that uses the slot has already been translated. Nothing makes the slot again, the lists run with an empty slot, and the mesh draws that read through it put nothing on screen. One frame later the write is early again and everything is back.
This also explains why every earlier remedy worked: a wait, a sleep, one translating thread, the frame recorder or the order rule of #43 all push translation past the title's late write.
What is changed
When the title writes a buffer view into a table slot that a draw of the frame under way has already read, the view is made at once instead of being left for a draw that will not come.
descriptor/host.rs: a per-slot mark, set only when a draw reads the slot directly through the title's table. A write of a buffer view into a slot marked for this frame is made on the spot. The existingtabledstamp and the texture path are untouched.draw.rs: the mark is set before the slot's record is read, so a write and a read of the same slot cannot both miss each other.tablewrite.rs(new): the few slots made this way are noted, and the submissions of the frame bring what those views show up to date.shadow.rs,host.rs: a small split ofShadow::refreshand the hand-over at the top ofHost::submit.It is cheap because it is rare: in the run above the rule acted about once every three frames, 1,928 times in four and a half minutes.
How the cause was found
The blink was measured rather than guessed at, one step at a time, each step a run of a few minutes.
VICTORY_ABflipping a switch every 8 seconds, each run compares two arms in the same scene.Measured
Radeon RX 9070 XT, Ryzen 9850X3D, Windows 11, 4K output with FSR 4 performance, ray tracing and frame generation, standing still in front of a treeline. The fix was scored in two separate A/B runs after about ten diagnostic runs of the same scene on the way there.
ca49e25), 4.5 minIn the run on main one small frame of 5 to 6 blocks, in another part of the picture, was counted in each arm.
Checked for Windows in the diagnostics and release profiles with warnings as errors, and with clippy at
-D warnings.Switch and log line
VICTORY_TABLE_WRITES(on;0gives the behaviour before this change). In a diagnostics build it can be flipped live withVICTORY_AB='8,VICTORY_TABLE_WRITES'.VICTORY_STATS_LOG=1, every 5 seconds:table writes (VICTORY_TABLE_WRITES), since the start: N buffer views made as the title wrote them into slots draws of the frame had read, ...Claude Fable 5.2
@SovietBearz0r on GitHub · 2026-12-05 22:48 UTC · original
Independent reproduction on a second RX 9070 XT, with a different scene than the author's treeline: the fix does what it says. Posting the method and numbers since the PR had no test reports yet.
Build: PR head
d772beeconmainatca49e259,diagprofile with--features diagnostics(cargo build --locked --profile diag -p victory --features diagnostics), Windows 11, RX 9070 XT, 4K output, FSR 4 performance, ray tracing + frame generation.Method: the repo's own popwatch (
VICTORY_POP_WATCH=0-100000, every frame's presented picture compared with its neighbours; a blip is a 16x16 block changed for exactly one frame) plus the benchmark's built-in cruise route (three measured spots:spawn_idle10 s standing at spawn,cruise_outandcruise_back15 s at 67 mph). Two runs in a row of the same route: one withVICTORY_TABLE_WRITES=0, one with the default (on). Blips counted only inside theBENCH_SPOT_START..BENCH_SPOT_ENDwindows, using the same "26 to 80 blocks hit" definition of a blink frame as the PR body. Run-to-run frame counts in the windows were nearly identical (136 vs 137 frames had any blip logged).VICTORY_TABLE_WRITES=0(as before)cruise_out, 25 incruise_back, 0 inspawn_idle)table writes (VICTORY_TABLE_WRITES), since the start: 433 buffer views made as the title wrote them into slots draws of the frame had read, 0 of them not noted, 213 ranges brought up to date with submissions.VICTORY_AB='8,VICTORY_TABLE_WRITES'in a single run; that was noisy and not usable (loading/world-entry blips dominate and the arms got unequal popwatch time). The two-run, spot-window-only numbers above are the reliable measurement.Nothing to change in the code from my side;
cargo xtask policyand the PR's CI are green, and this is the fix for the remaining one-frame tree/prop blink that #43 could only hide. One nit: the switch has no user-facing documentation (README/play.ps1do not mentionVICTORY_TABLE_WRITES); a one-line entry would make the A/B switch discoverable, but that shouldn't block the fix.Tested on the fork's copy of the branch; happy to re-run a standing-treeline A/B (with the author's spot/coordinates) or on an NVIDIA card if someone has one.
@Mbappinho on GitHub · 2026-12-05 22:53 UTC · original
One more reproduction, in a setting the two reports above do not cover: native 4K with no upscaler and no frame generation, and the hardware RT path of #81 too (with it this blink was more frequent here). Ryzen 7 9800X3D, RX 9070 XT, Windows 11,
-RayTracing -NoPcQuality, a still scene with a large plant that blinked often.One exe:
mainatca49e259with #81, #87 and this PR merged, plus a local switch for the hot-block rules from before627da774(see #81).VICTORY_HW_RT=1. Each run recorded 60 s of the window at 60 fps; a blink is a frame where more than 2% of the plant's region differs from both its neighbours while they agree.VICTORY_TABLE_WRITESThe same test over the whole window, cut in a 10x6 grid: 10 frames with a blink somewhere in each run with it off, all in the plant's area, and none anywhere with it on.
Same frame rate with it on and off (recording costs a few fps in both), and no device removal in any run. The log line said about 1,900 buffer views made as written over each run. Two unrecorded runs of the same exe with it on: 33.5 fps hardware RT, 32.4 software.
Made with Claude Code.
@randomuser1 on GitHub · 2026-12-05 23:05 UTC · original
old fashion test
~15mins real gameplay, seems to work, a single flicker, single tree after map close, probably different issue.
9070xt