watch: lock-free DirectStorage stream notices and soft-view guard fast paths #2655
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2655"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by 0x4e454f on 2026-11-29T15:37:37Z.
Summary
Cuts watch::writes() CPU overhead on streaming view windows (SoftViews / placeholder-backed 6 MB windows) by 61% (5,566 ms -> 2,192 ms per 10 s across refresh threads, 2.54x faster) without changing guard semantics or visual output.
Changes
ot_write_watched(first, last) (checking PROTECTED, inplace::cover, and PLACEHOLDERS) skips failing GetWriteWatch syscalls in writes(), sk_ahead(), sk_rest(), and sk_more().
Measured Impact (GTA 6 Series S open world, Windows Server 2025, 4c/8t Zen 2 + A10G)
efreshes per frame (wall-clock): 16.9–23.0 ms -> 12.1–16.5 ms
Verification
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CopiiDeco on 2026-11-29T19:42:08Z.
Tested this on Windows; two things worth a look.
Rig: Ryzen 5 5600X (6C/12T), RTX 3080 10 GB (driver 616.92), 32 GB DDR4-3600, B450 (PCIe 3.0), Windows 11 26200.
Setup: diagnostics build,
scripts/bench.ps1 -Dlss performance -FrameGen off -RayTracing off, Series S profile,VICTORY_WC_BAR=1 VICTORY_WINDOWS_BAR_MB=2048, same save and opening cutscene each run, 30 s warm-up + 120 s measured, pipelines precompiled.1. On its own (main
829188e9+ this PR): frame rate unchanged, but many more writes missed by the tracking.That warning is the safety net catching a write the watch/guards did not report, so ~6.7x more of them suggests some writes now go unnoticed. Textures get re-uploaded by that net; buffers might not have one, which is why I'm flagging it rather than calling it harmless.
2. Combined with other open PRs: an intermittent device-level failure. main + #2776 (with
VICTORY_INPLACE=1 VICTORY_INPLACE_VIEWS=1 VICTORY_SOFT_VIEWS=1) + #2656 + #2647 + #2745 + this PR (I resolved the textual conflicts inwatch.rsby keeping #2647's structure and adding this PR'snot_write_watchedfilter at the three places) failed about a minute into the cutscene:The same stack without this PR ran the full window with no failure, so it points here or at its interaction with those PRs. A rerun with
VICTORY_D3D12_DEBUG=1did not reproduce it in 5 minutes (the debug layer reported no errors, only resource-state warnings), so it looks timing-dependent, which would fit a race in the new lock-free paths (stream_memory_written, theBESIDEfast path inguard()).One run per configuration, ±0.4 fps run-to-run noise on this rig. I can rerun anything you want (timeline, other switches) if it helps.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CopiiDeco on 2026-11-29T19:56:50Z.
Correction to my comment above: please disregard the "a texture picked by index changed after its upload with nothing to tell of it" counts. I counted that warning across all of today's runs of unmodified main on this rig and it is bimodal from run to run (8, 27, 30, 52, 124, 160, 200, 201, 204 …), so the ~200 I saw with this PR is within main's own range and says nothing about missed writes. Sorry for the noise.
The rest stands as measured (one run per configuration, so treat the fps deltas as indicative).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CopiiDeco on 2026-11-30T00:00:09Z.
Correction on point 2 above: the device-level failure (
a host command list did not close (0x80070057)) is probably not this PR's. #2656 on its own was since reported to fail with the same error on another rig (2 runs out of 2, in the plane cutscene), and #2656 was in my five-PR stack too; the run without this PR that passed was one run of an intermittent failure. Sorry for pointing it here.