Launcher: shader writes into write-combined copies from 64 KB stay on the card #521

Open
voiceovarian1-max wants to merge 1 commit from upstream-pr/521 into main
voiceovarian1-max commented 2026-12-02 23:03:52 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by voiceovarian1-max on 2026-12-02T23:03:52Z.


The launcher keeps shader writes into write-combined copies on the card from 64 KB instead of 1 MB (VICTORY_WC_NO_BACK_MIN_KB 1024 → 64). This stops a character's clothes flickering dark or bright in single frames.

What was wrong

At 1024 KB, shader writes into a write-combined copy between 64 KB and 1 MB go back to title memory: compare, fetch, and merge after the flight lands. In a scene early in the game, a character's clothes were then drawn black, or brighter, in single frames. It happened on upstream main at ~37 fps and on a faster local build at ~45 fps. With the copy's writes left on the card, the frames are clean.

The exact bytes read stale were not found. This keeps the copy off the write-back path; it does not fix a race on that path. ProjectLeonida/mandy keeps the 1 MB threshold and does not flicker, so the race is somewhere in foxhound's write-back of shader writes (the relay's fetch and merge, or the merges under writes while flights are in the air). It may be behind other flicker reports too (#306, #413).

Copies under 64 KB (results the title reads back) still go back. 0 (every copy left on the card) was clean in one run on the local build too. It made heavy scenes near black once on 2026-11-26, so it is not proposed.

What is in it

  • scripts/play-foxhound.ps1: VICTORY_WC_NO_BACK_MIN_KB 1024 → 64, with the reason.
  • README.md: the default in the switch table.

Tested

  • RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; release builds; Series S profile, DLSS Balanced, 60 fps limit.
  • Method: a burst of ~65 pictures 100-122 s into each run (every 150 ms), with the brightness of the clothes measured. A sharp change is one picture at least 12 levels darker or brighter than both of its neighbours. Runs alternate on one boot; fps is the median over the burst window.
  • This branch's base, upstream main 7dbcdcb:
    • 1024 KB: 7 of 65 (4 dark, 3 bright) at 36.6 fps; 3 of 63 (1 dark, 2 bright) at 36.5 fps.
    • 64 KB: 0 of 66 at 37.3 fps; 0 of 65 at 36.1 fps.
  • A local build with ports from mandy:
    • 1024 KB: 6 of 68 dark at 44.9 fps; ~8 of 67 at 45.2 fps.
    • 64 KB: 0 of 68 at 46.9 fps; 0 of 68 at 46.2 fps.
  • Slower variants were also clean, but only because they were slower: indirect batching off (33 fps), thin threads off (29), and a 30 fps cap on the local build. Compare flicker counts only at the same frame rate.
  • No Rust code changes, so no cargo test run for this.

Not tested

  • AMD and Intel cards; the Series X profile; other scenes; a long play session (stale small read-backs under 64 KB).
  • The race on the write-back path itself is not fixed.

AI use

Claude Code with Claude Opus 5.5 found the setting with the A/B runs above (each one a real run on the hardware named), wrote the change and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:readmet3xt-lab/foxhound:issue:5616288363 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/521). Originally posted by [voiceovarian1-max](https://github.com/voiceovarian1-max) on 2026-12-02T23:03:52Z. --- The launcher keeps shader writes into write-combined copies on the card from 64 KB instead of 1 MB (`VICTORY_WC_NO_BACK_MIN_KB` 1024 → 64). This stops a character's clothes flickering dark or bright in single frames. **What was wrong** At 1024 KB, shader writes into a write-combined copy between 64 KB and 1 MB go back to title memory: compare, fetch, and merge after the flight lands. In a scene early in the game, a character's clothes were then drawn black, or brighter, in single frames. It happened on upstream `main` at ~37 fps and on a faster local build at ~45 fps. With the copy's writes left on the card, the frames are clean. The exact bytes read stale were not found. This keeps the copy off the write-back path; it does not fix a race on that path. ProjectLeonida/mandy keeps the 1 MB threshold and does not flicker, so the race is somewhere in foxhound's write-back of shader writes (the relay's fetch and merge, or the merges under writes while flights are in the air). It may be behind other flicker reports too (#306, #413). Copies under 64 KB (results the title reads back) still go back. `0` (every copy left on the card) was clean in one run on the local build too. It made heavy scenes near black once on 2026-11-26, so it is not proposed. **What is in it** - `scripts/play-foxhound.ps1`: `VICTORY_WC_NO_BACK_MIN_KB` 1024 → 64, with the reason. - `README.md`: the default in the switch table. **Tested** - RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; release builds; Series S profile, DLSS Balanced, 60 fps limit. - Method: a burst of ~65 pictures 100-122 s into each run (every 150 ms), with the brightness of the clothes measured. A sharp change is one picture at least 12 levels darker or brighter than both of its neighbours. Runs alternate on one boot; fps is the median over the burst window. - **This branch's base, upstream `main` 7dbcdcb:** - 1024 KB: 7 of 65 (4 dark, 3 bright) at 36.6 fps; 3 of 63 (1 dark, 2 bright) at 36.5 fps. - 64 KB: 0 of 66 at 37.3 fps; 0 of 65 at 36.1 fps. - **A local build with ports from mandy:** - 1024 KB: 6 of 68 dark at 44.9 fps; ~8 of 67 at 45.2 fps. - 64 KB: 0 of 68 at 46.9 fps; 0 of 68 at 46.2 fps. - Slower variants were also clean, but only because they were slower: indirect batching off (33 fps), thin threads off (29), and a 30 fps cap on the local build. Compare flicker counts only at the same frame rate. - No Rust code changes, so no `cargo test` run for this. **Not tested** - AMD and Intel cards; the Series X profile; other scenes; a long play session (stale small read-backs under 64 KB). - The race on the write-back path itself is not fixed. **AI use** Claude Code with Claude Opus 5.5 found the setting with the A/B runs above (each one a real run on the hardware named), wrote the change and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tillo88 commented 2026-12-03 03:44:45 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by tillo88 on 2026-12-03T03:44:45Z.


Replay-bench measurement: no measurable difference on v0.8.3.3 in 2 of 3 runs; one slow run, cause unknown

Measured: PR head 381a5ee merged onto release v0.8.3.3 (same code as main 7dbcdcb). Since the PR changes the launcher's default, the bench set VICTORY_WC_NO_BACK_MIN_KB=64 directly for the layer. 3 measured runs in two jobs (each after a warm-up run that is not counted), against 8 runs of v0.8.3.3 without the PR, same route (~6.5 min). The bench does not measure flicker.

run fps CPU prep ms median ms p95 ms p99 ms frames > 100 ms
release (8 runs, mean; fps range 36.15-37.12) 36.60 19.57 28.45 39.70 47.35 14.9
PR #521 + VICTORY_WC_NO_BACK_MIN_KB=64 run 1 36.23 19.14 29.30 39.49 54.22 12
PR #521 + VICTORY_WC_NO_BACK_MIN_KB=64 run 2 9.94 86.93 108.15 357.29 390.33 1031
PR #521 + VICTORY_WC_NO_BACK_MIN_KB=64 run 3 37.05 18.61 28.00 38.68 45.23 13

Mean fps over the two normal runs: 36.64 vs 36.60 (+0.1%), which is no measurable difference. Run 2 was slow for most of the route; the layer logged no error. Release runs with identical switches fell into a similar slow state on this bench before (6-9 fps average) for an unknown reason, so we cannot tell whether this run is related to the switch.

Crashes: none in the PR runs and none in the release runs (no host GPU failure, no device lost).

Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; default play-foxhound.ps1 settings (Series X profile, 1440p, DLSS balanced, no frame generation), fullscreen, no frame cap.

Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7366890003 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/521#issuecomment-7366890003). Originally posted by [tillo88](https://github.com/tillo88) on 2026-12-03T03:44:45Z. --- **Replay-bench measurement: no measurable difference on v0.8.3.3 in 2 of 3 runs; one slow run, cause unknown** Measured: PR head `381a5ee` merged onto release **v0.8.3.3** (same code as main `7dbcdcb`). Since the PR changes the launcher's default, the bench set `VICTORY_WC_NO_BACK_MIN_KB=64` directly for the layer. 3 measured runs in two jobs (each after a warm-up run that is not counted), against 8 runs of v0.8.3.3 without the PR, same route (~6.5 min). The bench does not measure flicker. | run | fps | CPU prep ms | median ms | p95 ms | p99 ms | frames > 100 ms | |---|---|---|---|---|---|---| | release (8 runs, mean; fps range 36.15-37.12) | 36.60 | 19.57 | 28.45 | 39.70 | 47.35 | 14.9 | | PR #521 + VICTORY_WC_NO_BACK_MIN_KB=64 run 1 | 36.23 | 19.14 | 29.30 | 39.49 | 54.22 | 12 | | PR #521 + VICTORY_WC_NO_BACK_MIN_KB=64 run 2 | 9.94 | 86.93 | 108.15 | 357.29 | 390.33 | 1031 | | PR #521 + VICTORY_WC_NO_BACK_MIN_KB=64 run 3 | 37.05 | 18.61 | 28.00 | 38.68 | 45.23 | 13 | Mean fps over the two normal runs: 36.64 vs 36.60 (+0.1%), which is **no measurable difference**. Run 2 was slow for most of the route; the layer logged no error. Release runs with identical switches fell into a similar slow state on this bench before (6-9 fps average) for an unknown reason, so we cannot tell whether this run is related to the switch. Crashes: none in the PR runs and none in the release runs (no host GPU failure, no device lost). Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; default `play-foxhound.ps1` settings (Series X profile, 1440p, DLSS balanced, no frame generation), fullscreen, no frame cap. Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.
voiceovarian1-max commented 2026-12-03 07:46:20 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by voiceovarian1-max on 2026-12-03T07:46:20Z.


Thanks for the bench runs. They agree with ours on speed: on upstream main 7dbcdcb the two 64 KB runs here were 37.3 and 36.1 fps against 36.6 and 36.5 at 1024 KB, so the change is for the flicker, not for frame rate.

None of the five runs at 64 KB here (two on main, three on a local build; RTX 4070 Ti 12 GB, Series S profile) was slow in the 22 s we measured, but five runs cannot rule out the state your run 2 fell into. Yours are the first runs on the Series X profile: no crash there; the flicker itself is not checked on that profile yet.

Written with Claude Code (Claude Opus 5.5) from the runs in the description.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7371406245 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/521#issuecomment-7371406245). Originally posted by [voiceovarian1-max](https://github.com/voiceovarian1-max) on 2026-12-03T07:46:20Z. --- Thanks for the bench runs. They agree with ours on speed: on upstream `main` 7dbcdcb the two 64 KB runs here were 37.3 and 36.1 fps against 36.6 and 36.5 at 1024 KB, so the change is for the flicker, not for frame rate. None of the five runs at 64 KB here (two on `main`, three on a local build; RTX 4070 Ti 12 GB, Series S profile) was slow in the 22 s we measured, but five runs cannot rule out the state your run 2 fell into. Yours are the first runs on the Series X profile: no crash there; the flicker itself is not checked on that profile yet. Written with Claude Code (Claude Opus 5.5) from the runs in the description.
voiceovarian1-max commented 2026-12-03 10:04:30 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by voiceovarian1-max on 2026-12-03T10:04:30Z.


Combined test of this PR with #521, #543 and #544-#556, all merged onto main 7dbcdcb (branch fox-all of voiceovarian1-max/foxhound):

  • RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; release.
  • cargo test --workspace --locked -- --test-threads=4: 1,415 passed, 0 failed, 50 ignored (29 binaries), no SKIPPED.
  • Retail title, Series S profile, DLSS Balanced, 60 fps limit, keys pressed by the layer only (VICTORY_KEYS, no input from the PC): window scene 38-42 fps against 34-37 for main on the same boot; no device removal, no crash; a burst of 67 pictures showed no one-picture flicker of the character's clothes.
  • Not tested: each PR alone in the game; AMD and Intel; the Series X profile; long play.

Tested by Claude Code with Claude Opus 5.5 on the hardware named.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7374696172 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/521#issuecomment-7374696172). Originally posted by [voiceovarian1-max](https://github.com/voiceovarian1-max) on 2026-12-03T10:04:30Z. --- Combined test of this PR with #521, #543 and #544-#556, all merged onto `main` 7dbcdcb (branch fox-all of voiceovarian1-max/foxhound): - RTX 4070 Ti 12 GB (driver 617.14), i7-14700K, 32 GB, Windows 11 Pro 26300; release. - `cargo test --workspace --locked -- --test-threads=4`: 1,415 passed, 0 failed, 50 ignored (29 binaries), no `SKIPPED`. - Retail title, Series S profile, DLSS Balanced, 60 fps limit, keys pressed by the layer only (`VICTORY_KEYS`, no input from the PC): window scene 38-42 fps against 34-37 for `main` on the same boot; no device removal, no crash; a burst of 67 pictures showed no one-picture flicker of the character's clothes. - Not tested: each PR alone in the game; AMD and Intel; the Series X profile; long play. Tested by Claude Code with Claude Opus 5.5 on the hardware named.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/521:upstream-pr/521'
git switch 'upstream-pr/521'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/521'
git switch 'upstream-pr/521'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/521'
git switch 'upstream-pr/521'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/521'
git switch 'main'
git merge --squash 'upstream-pr/521'
git switch 'main'
git merge --ff-only 'upstream-pr/521'
git switch 'main'
git merge 'upstream-pr/521'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
readmet3xt-lab/foxhound!521
No description provided.