Where the frame goes on a 4060 Ti: compute is 93% of the GPU time, two passes are 73 ms, one list costs 82 ms #10

Open
opened 2026-11-26 03:34:30 +00:00 by github-bot · 14 comments
Owner

@⁠rocobalt1 on GitHub · 2026-11-24 19:41 UTC · original

Where the frame goes on a 4060 Ti, measured with your own VICTORY_GPU_TIMING and VICTORY_DISPLAY_MODE. Numbers only; no assets.

Setup: RTX 4060 Ti 8 GB, driver 32.0.16.1656, Ryzen 9 5900X, 64 GB, Windows 11; fork 004bf69, diag build (--profile diag --features diagnostics), VICTORY_NO_WATCHDOG=1, VICTORY_SHADER_LOOP_LIMIT=32, VICTORY_DISPLAY_MODE=1920x1080, fresh VICTORY_DATA_DIR. Driven with VICTORY_KEYS. Shadows render and the prologue shows characters, sky and lighting.

1. Resolution is not the lever

Same save, same scene family, averages over world frames with >800 draws:

3840x2160 1920x1080
frame 656 ms 621 ms
on the GPU 258 ms 244 ms
copies 67 ms 68 ms
copying back 98 ms 92 ms
textures 51 ms 44 ms
draws/frame 4 740 4 354

Four times fewer pixels moved the GPU by 5 %. So the GPU time is per dispatch, not fill rate. (Good news for the port: you do not need to drop resolution to gain time.)

2. Where the GPU time goes (VICTORY_GPU_TIMING=1)

The complete per-pipeline table, summed per frame over 144 pipelines:

kind pipelines ms/frame share
indirect compute 65 224 ms 59 %
dispatch compute 52 131 ms 34 %
indexed (vertex/pixel) 12 12 ms 3 %
indirect mesh 7 9 ms 2 %
draw 8 4 ms 1 %

Top of the table:

39.02 ms  2 cmds     max 90.36   indirect compute 6d7fe7745ab9c6d8
34.28 ms  1 cmd      max 42.03   indirect compute cfd83392ec9ae408
15.14 ms  1 cmd      max 29.59   dispatch compute cb6adcc6da2613ff
12.47 ms  1 cmd      max 15.17   dispatch compute 5cf00dc39042edaf
 9.06 ms  91 cmds    max  0.92   dispatch compute 1ea7e2dbf731c8dc
 8.98 ms  1 cmd      max 40.65   indirect compute 3592426e3e9142d8
 8.86 ms  1001 cmds  max  0.32   indirect mesh    9f1f95875944d82a
 8.83 ms  2 cmds     max 17.63   indirect compute dd411d22d78b3625
 8.13 ms  1 cmd      max 60.45   dispatch compute f0c91b4d2578f5bf
 7.89 ms  1 cmd      max 62.82   indirect vertex  1d7b30217b395cd8
 6.80 ms  2 cmds     max 54.23   indirect compute 321cc098721d9ca3
 6.31 ms  47 cmds    max  4.11   dispatch compute 540f95f82b88cc7c
 6.28 ms  48 cmds    max  3.62   dispatch compute f2893f8f183a696a
 5.77 ms  1 cmd      max  6.09   indirect compute 7168dd781ca7efb9

Three readings that matter for the port:

  1. A thousand mesh commands cost 8.9 ms; two compute commands cost 73 ms. Whatever those two indirect computes do is ten times all of the mesh drawing together. If they are screen-space passes (shadow, lighting, SSAO), half resolution is the lever; if they are BVH/ray work, VICTORY_BVH_BUILDER off by default may already be the cheap case and worth confirming.
  2. Per-command overhead is small: 1 001 mesh commands with a 0.32 ms longest means ~9 us each. There is nothing to win by batching draws; the CPU side is the other outlier (see 3).
  3. Total measured: 381 ms/frame across 144 pipelines, against the ~325 ms the frame line reports for the GPU.

3. A CPU outlier worth a look

WARN slow host list ms=82 commands=76

82 ms to prepare one list of 76 commands, repeated every frame. That is about 1 ms per command, which looks like per-command work (pipeline lookup? root table?) rather than copying - copies in the frame line is only 67 ms for 166 MB.

4. Two smaller observations

  • Black stretches are not constant. Over two recordings of the same build: one 300 s window had 0 black frames of 75 sampled; a 420 s window had 8, with one 20 s stretch. So whatever drops the composition happens in windows, not per frame.
  • Overexposure: several frames peak at 220-255 mean (scene washed to white, e.g. a window-lit silhouette), while others are correct. That looks like exposure/tone-mapping reading a target that is not written in every frame.

If it helps, I can run a head with VICTORY_GPU_TIMING at a lower "slow" threshold (or no threshold) to get the full per-command distribution, which would say whether the 270 ms really is spread evenly over 4-5 k draws or hides another few passes.

**@⁠rocobalt1** on GitHub · 2026-11-24 19:41 UTC · [original](https://github.com/fxceless/victory-fork/issues/10) Where the frame goes on a 4060 Ti, measured with your own `VICTORY_GPU_TIMING` and `VICTORY_DISPLAY_MODE`. Numbers only; no assets. **Setup:** RTX 4060 Ti 8 GB, driver 32.0.16.1656, Ryzen 9 5900X, 64 GB, Windows 11; fork `004bf69`, diag build (`--profile diag --features diagnostics`), `VICTORY_NO_WATCHDOG=1`, `VICTORY_SHADER_LOOP_LIMIT=32`, `VICTORY_DISPLAY_MODE=1920x1080`, fresh `VICTORY_DATA_DIR`. Driven with `VICTORY_KEYS`. Shadows render and the prologue shows characters, sky and lighting. ## 1. Resolution is not the lever Same save, same scene family, averages over world frames with >800 draws: | | 3840x2160 | 1920x1080 | |---|---:|---:| | frame | 656 ms | 621 ms | | **on the GPU** | **258 ms** | **244 ms** | | copies | 67 ms | 68 ms | | copying back | 98 ms | 92 ms | | textures | 51 ms | 44 ms | | draws/frame | 4 740 | 4 354 | Four times fewer pixels moved the GPU by **5 %**. So the GPU time is per dispatch, not fill rate. (Good news for the port: you do not need to drop resolution to gain time.) ## 2. Where the GPU time goes (`VICTORY_GPU_TIMING=1`) The complete per-pipeline table, summed per frame over 144 pipelines: | kind | pipelines | ms/frame | share | |---|---:|---:|---:| | **indirect compute** | 65 | **224 ms** | 59 % | | **dispatch compute** | 52 | **131 ms** | 34 % | | indexed (vertex/pixel) | 12 | 12 ms | 3 % | | indirect mesh | 7 | 9 ms | 2 % | | draw | 8 | 4 ms | 1 % | Top of the table: ``` 39.02 ms 2 cmds max 90.36 indirect compute 6d7fe7745ab9c6d8 34.28 ms 1 cmd max 42.03 indirect compute cfd83392ec9ae408 15.14 ms 1 cmd max 29.59 dispatch compute cb6adcc6da2613ff 12.47 ms 1 cmd max 15.17 dispatch compute 5cf00dc39042edaf 9.06 ms 91 cmds max 0.92 dispatch compute 1ea7e2dbf731c8dc 8.98 ms 1 cmd max 40.65 indirect compute 3592426e3e9142d8 8.86 ms 1001 cmds max 0.32 indirect mesh 9f1f95875944d82a 8.83 ms 2 cmds max 17.63 indirect compute dd411d22d78b3625 8.13 ms 1 cmd max 60.45 dispatch compute f0c91b4d2578f5bf 7.89 ms 1 cmd max 62.82 indirect vertex 1d7b30217b395cd8 6.80 ms 2 cmds max 54.23 indirect compute 321cc098721d9ca3 6.31 ms 47 cmds max 4.11 dispatch compute 540f95f82b88cc7c 6.28 ms 48 cmds max 3.62 dispatch compute f2893f8f183a696a 5.77 ms 1 cmd max 6.09 indirect compute 7168dd781ca7efb9 ``` Three readings that matter for the port: 1. **A thousand mesh commands cost 8.9 ms; two compute commands cost 73 ms.** Whatever those two indirect computes do is ten times all of the mesh drawing together. If they are screen-space passes (shadow, lighting, SSAO), half resolution is the lever; if they are BVH/ray work, `VICTORY_BVH_BUILDER` off by default may already be the cheap case and worth confirming. 2. **Per-command overhead is small**: 1 001 mesh commands with a 0.32 ms longest means ~9 us each. There is nothing to win by batching draws; the CPU side is the other outlier (see 3). 3. **Total measured: 381 ms/frame across 144 pipelines**, against the ~325 ms the frame line reports for the GPU. ## 3. A CPU outlier worth a look ``` WARN slow host list ms=82 commands=76 ``` 82 ms to prepare one list of 76 commands, repeated every frame. That is about 1 ms per command, which looks like per-command work (pipeline lookup? root table?) rather than copying - `copies` in the frame line is only 67 ms for 166 MB. ## 4. Two smaller observations - **Black stretches are not constant.** Over two recordings of the same build: one 300 s window had **0 black frames of 75 sampled**; a 420 s window had 8, with one **20 s** stretch. So whatever drops the composition happens in windows, not per frame. - **Overexposure:** several frames peak at 220-255 mean (scene washed to white, e.g. a window-lit silhouette), while others are correct. That looks like exposure/tone-mapping reading a target that is not written in every frame. If it helps, I can run a head with `VICTORY_GPU_TIMING` at a lower "slow" threshold (or no threshold) to get the full per-command distribution, which would say whether the 270 ms really is spread evenly over 4-5 k draws or hides another few passes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:34:30 +00:00
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-24 21:28 UTC · original

Your table gives the missing comparison for the same four lanes on a different runtime, so here they are from a Linux/Proton host, measured with the same frame line (fork 4e17478, release build, RX 7900 XT/RDNA3, Mesa 26.3.1 RADV, Proton Experimental experimental-11.0-20261112, vkd3d-proton 3.2.0, 60-minute continuous run, world-streaming frames with 700–6 300 draws):

your 4060 Ti (Windows) this RDNA3 (Linux/Proton)
frame 656 ms 4 154–15 277 ms
on the GPU 258 ms 54–241 ms
copies 67 ms 1 645–3 173 ms (102–152 MB)
copying back 98 ms 60–2 202 ms (4–19 MB)
textures 51 ms 2 435–2 710 ms (7.6–29.7 MB)

Two readings of that, and the second is the one I would act on.

The GPU half agrees with you. Resolution and GPU pass cost are not the lever on either platform; on Linux the card is 1–4 % of the frame whatever is on screen, so #10's GPU-side conclusions hold there too.

The copy lanes are 25–45x more expensive under Wine for the same work. Your copies is 67 ms; ours is 1 645 ms and up. The bytes do not explain it: a 128 MiB probe in the same prefix does 21.3 GB/s of mapped upload writes, 143–163 GB/s of card copies and 12.6 GB/s of readback, and the layer's own per-buffer stats show its largest single copy at 156 MB in 2.46 ms. What the lane is actually doing per frame, from the diagnostics build's counters:

  • 21.7 GB of ranges asked about to find 186 MB of changes — 3 552 GetWriteWatch calls over 18 198 refreshes, 97.8 % of what it asks about is unchanged. That asking alone is 1 169 ms of a 3 428 ms lane (34 %).
  • The bulk kernel reads are 129 ms (4 %).
  • 2 131 ms (62 %) is host bookkeeping the logged build does not attribute — Shadow::update builds a fresh Vec over |pending| on every one of the 18k refreshes, and failed bulk reads fall back to read_sparse/read_pieces with a VirtualQuery per region (144–1 371 fallbacks per frame).

So the difference against your numbers is most likely in the syscalls Wine emulates — GetWriteWatch over multi-megabyte ranges, ReadProcessMemory per piece — not in what the layer asks for. That is a hypothesis I have not isolated; the counters that would settle it exist in the current tree and I have not spent a run on them yet.

If you want a comparable experiment on Windows: VICTORY_ASK_ONCE=0/1 (per-asking vs per-buffer asks) and VICTORY_COPY_MODE=none/plain bound the lane on your machine in two 2-minute runs, and would say whether the per-call cost you see is the same shape as ours or genuinely Linux-specific.

**@⁠rostaddotcc** on GitHub · 2026-11-24 21:28 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7144984295) Your table gives the missing comparison for the same four lanes on a different runtime, so here they are from a Linux/Proton host, measured with the same frame line (fork `4e17478`, release build, RX 7900 XT/RDNA3, Mesa 26.3.1 RADV, Proton Experimental `experimental-11.0-20261112`, vkd3d-proton 3.2.0, 60-minute continuous run, world-streaming frames with 700–6 300 draws): | | your 4060 Ti (Windows) | this RDNA3 (Linux/Proton) | |---|---:|---:| | frame | 656 ms | 4 154–15 277 ms | | on the GPU | 258 ms | 54–241 ms | | copies | 67 ms | 1 645–3 173 ms (102–152 MB) | | copying back | 98 ms | 60–2 202 ms (4–19 MB) | | textures | 51 ms | 2 435–2 710 ms (7.6–29.7 MB) | Two readings of that, and the second is the one I would act on. **The GPU half agrees with you.** Resolution and GPU pass cost are not the lever on either platform; on Linux the card is 1–4 % of the frame whatever is on screen, so #10's GPU-side conclusions hold there too. **The copy lanes are 25–45x more expensive under Wine for the same work.** Your `copies` is 67 ms; ours is 1 645 ms and up. The bytes do not explain it: a 128 MiB probe in the same prefix does 21.3 GB/s of mapped upload writes, 143–163 GB/s of card copies and 12.6 GB/s of readback, and the layer's own per-buffer stats show its largest single copy at 156 MB in 2.46 ms. What the lane is actually doing per frame, from the diagnostics build's counters: - **21.7 GB of ranges asked about to find 186 MB of changes** — 3 552 `GetWriteWatch` calls over 18 198 refreshes, 97.8 % of what it asks about is unchanged. That asking alone is 1 169 ms of a 3 428 ms lane (34 %). - The bulk kernel reads are 129 ms (4 %). - **2 131 ms (62 %) is host bookkeeping the logged build does not attribute** — `Shadow::update` builds a fresh `Vec` over `|pending|` on every one of the 18k refreshes, and failed bulk reads fall back to `read_sparse`/`read_pieces` with a `VirtualQuery` per region (144–1 371 fallbacks per frame). So the difference against your numbers is most likely in the syscalls Wine emulates — `GetWriteWatch` over multi-megabyte ranges, `ReadProcessMemory` per piece — not in what the layer asks for. That is a hypothesis I have not isolated; the counters that would settle it exist in the current tree and I have not spent a run on them yet. If you want a comparable experiment on Windows: `VICTORY_ASK_ONCE=0/1` (per-asking vs per-buffer asks) and `VICTORY_COPY_MODE=none/plain` bound the lane on your machine in two 2-minute runs, and would say whether the per-call cost you see is the same shape as ours or genuinely Linux-specific.
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-24 21:40 UTC · original

Two things about the switches your run used, both read out of 4e17478, because they change how those numbers should be compared.

VICTORY_GPU_TIMING silently pins the late-wait stage to 0. In host.rs:1678-1680:

fn late_stage() -> u8 {
    *STAGE.get_or_init(|| {
        if std::env::var_os("VICTORY_GPU_TIMING").is_some() {
            return 0;
        }
        match std::env::var("VICTORY_LATE_WAIT").as_deref() { ... }

So a run with VICTORY_GPU_TIMING set cannot also have VICTORY_LATE_WAIT=1/2/3 — including the case where relay alone would have given stage 3 (Err(_) if crate::shadow::relay() => 3). If your 656 ms frames were taken with the timing switch on and relay or late-wait otherwise enabled, that run describes a different configuration than a normal one, which is the same class of trap as VICTORY_INDIRECT having been cfg!(feature = "diagnostics")-gated: the measurement switch changes the thing being measured. Worth either documenting next to the switch or printing the resolved stage in the frame line.

VICTORY_ASK_ONCE is already the default, so the A/B direction is =0, not =1 (watch.rs:161-166, on since run 81 for 375-450 ms against 573-647 ms a frame). Same for VICTORY_CARD_BUFFERS (on unless =0) and VICTORY_LATE_WAIT (0 unless relay is set). The ones that need switching on are VICTORY_WIDE_REFRESH=1, VICTORY_CARD_REHASH_RUNS=1, VICTORY_TEXTURE_NO_WAIT=1.

For reference, the resolved defaults on this tree:

switch default effect on the copy lanes
VICTORY_ASK_ONCE on one asking per submission instead of one per range
VICTORY_WINDOW_KB 4 MiB grid window size for an ask without a length (64 KiB–4 MiB, powers of two)
VICTORY_WIDE_REFRESH off refresh across threads
VICTORY_COPY_MODE guarded plain copies without the guard, none skips them
VICTORY_CARD_BUFFERS on copies of big buffers live in card memory
VICTORY_CARD_REHASH_RUNS off joins the per-range hash passes into one
VICTORY_TEXTURE_NO_WAIT off texture refresh does not wait for title memory to hold still
VICTORY_LATE_WAIT 0 (3 under relay) how far submissions are sent ahead of the wait
VICTORY_INPLACE 0 how much title memory is read in place

None of these is gated behind a cargo feature at this commit — I checked each one's only read site — so a release build honours them all.

**@⁠rostaddotcc** on GitHub · 2026-11-24 21:40 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7145233453) Two things about the switches your run used, both read out of `4e17478`, because they change how those numbers should be compared. **`VICTORY_GPU_TIMING` silently pins the late-wait stage to 0.** In `host.rs:1678-1680`: ```rust fn late_stage() -> u8 { *STAGE.get_or_init(|| { if std::env::var_os("VICTORY_GPU_TIMING").is_some() { return 0; } match std::env::var("VICTORY_LATE_WAIT").as_deref() { ... } ``` So a run with `VICTORY_GPU_TIMING` set cannot also have `VICTORY_LATE_WAIT=1/2/3` — including the case where relay alone would have given stage 3 (`Err(_) if crate::shadow::relay() => 3`). If your 656 ms frames were taken with the timing switch on and relay or late-wait otherwise enabled, that run describes a different configuration than a normal one, which is the same class of trap as `VICTORY_INDIRECT` having been `cfg!(feature = "diagnostics")`-gated: the measurement switch changes the thing being measured. Worth either documenting next to the switch or printing the resolved stage in the frame line. **`VICTORY_ASK_ONCE` is already the default**, so the A/B direction is `=0`, not `=1` (`watch.rs:161-166`, on since run 81 for 375-450 ms against 573-647 ms a frame). Same for `VICTORY_CARD_BUFFERS` (on unless `=0`) and `VICTORY_LATE_WAIT` (0 unless relay is set). The ones that need switching *on* are `VICTORY_WIDE_REFRESH=1`, `VICTORY_CARD_REHASH_RUNS=1`, `VICTORY_TEXTURE_NO_WAIT=1`. For reference, the resolved defaults on this tree: | switch | default | effect on the copy lanes | |---|---|---| | `VICTORY_ASK_ONCE` | on | one asking per submission instead of one per range | | `VICTORY_WINDOW_KB` | 4 MiB grid | window size for an ask without a length (64 KiB–4 MiB, powers of two) | | `VICTORY_WIDE_REFRESH` | off | refresh across threads | | `VICTORY_COPY_MODE` | `guarded` | `plain` copies without the guard, `none` skips them | | `VICTORY_CARD_BUFFERS` | on | copies of big buffers live in card memory | | `VICTORY_CARD_REHASH_RUNS` | off | joins the per-range hash passes into one | | `VICTORY_TEXTURE_NO_WAIT` | off | texture refresh does not wait for title memory to hold still | | `VICTORY_LATE_WAIT` | 0 (3 under relay) | how far submissions are sent ahead of the wait | | `VICTORY_INPLACE` | 0 | how much title memory is read in place | None of these is gated behind a cargo feature at this commit — I checked each one's only read site — so a release build honours them all.
Author
Owner

@⁠HenriqueSBueno on GitHub · 2026-11-24 21:44 UTC · original

Your result that resolution barely moves GPU time (−5 % for 4x fewer pixels) fits two things the dossier in Marvisak/VIctory#1317 flags as per-dispatch costs, both still present at 4e17478:

  • Occlusion queries always answer "visible" (list.rs:1356, OCCLUSION => Written::Value(1 << 20)), and GPU timestamps are CPU time taken after the wait. The title's own occlusion culling therefore never removes anything. Every object's culling and indirect work runs, and that cost does not scale with resolution (H-8.1/H-8.2).
  • Every ExecuteIndirect gets a clamp dispatch plus UAV barriers without a resource, which drain all in-flight work. With ~3,000 mesh ExecuteIndirect calls of max=1 a frame (#107, @⁠ryotdev's count), the drains alone can explain a large share of "compute is 93 %" (H-7.4/H-7.5).

A cheap experiment for the second one: a diagnostics switch that skips the clamp for signatures with max=1 and a known-valid count buffer, plus resource-scoped barriers. Then compare VICTORY_GPU_TIMING totals. For the first, real query heaps with resolved timestamps would also let the title's dynamic resolution react.

AI-assisted (Claude Code)

**@⁠HenriqueSBueno** on GitHub · 2026-11-24 21:44 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7145332801) Your result that resolution barely moves GPU time (−5 % for 4x fewer pixels) fits two things the dossier in Marvisak/VIctory#1317 flags as per-dispatch costs, both still present at `4e17478`: - **Occlusion queries always answer "visible"** (`list.rs:1356`, `OCCLUSION => Written::Value(1 << 20)`), and GPU timestamps are CPU time taken after the wait. The title's own occlusion culling therefore never removes anything. Every object's culling and indirect work runs, and that cost does not scale with resolution (H-8.1/H-8.2). - **Every `ExecuteIndirect` gets a clamp dispatch plus UAV barriers without a resource**, which drain all in-flight work. With ~3,000 mesh `ExecuteIndirect` calls of `max=1` a frame (#107, @⁠ryotdev's count), the drains alone can explain a large share of "compute is 93 %" (H-7.4/H-7.5). A cheap experiment for the second one: a diagnostics switch that skips the clamp for signatures with `max=1` and a known-valid count buffer, plus resource-scoped barriers. Then compare `VICTORY_GPU_TIMING` totals. For the first, real query heaps with resolved timestamps would also let the title's dynamic resolution react. AI-assisted (Claude Code)
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-24 21:49 UTC · original

Ran the counters the diagnostics build already has, on the loading/streaming phase here (RX 7900 XT/RDNA3, RADV, Proton Experimental, fork 4e17478, diag build, no new switches — VICTORY_NO_WATCHDOG=1 VICTORY_SHADER_LOOP_LIMIT=256 and the d3d12 override). Three minutes, frames 5 511–8 157 ms, GPU 87–195 ms, 1 777–5 292 draws. This closes the "what is inside the copy lane" question that my earlier comment left open.

Per frame, from copies per frame and recording per frame:

The counters print per window between two frame lines, so these are the last two windows of the run, not two chosen frames:

window 1 (last) window 2
copies (frame line) 2 664 ms 2 019 ms
write-watch askings (watches) 2 317 ms 1 055 ms
bytes asked about / unchanged 7.58 GB / 7.44 GB (98.1 %) 15.7 GB / 15.5 GB (98.8 %)
of which askings ≥ 1 ms 326 calls → 2 269 ms, longest 365 ms 115 calls → 612 ms
guard-fault time (guards) 1 264 ms 629 ms
sparse reads (sparse reads) 286 ms 208 ms
bulk kernel moves (moves) 65 ms 75 ms
fallbacks / guard faults 48 / 146 104 / 230

So the lane that was 56–73 % "unattributed" is now attributed: asking + guards + sparse + moves account for essentially all of it, and asking dominates at ~50–85 %, with the single worst asking pinning the frame twice in this run: a 365 ms GetWriteWatch, and in one earlier frame 748 ms. On a runtime whose mapped reads run at 21 GB/s, a 748 ms asking is not moving bytes — it is waiting for something. The shape is a long tail, not a uniform cost: 326 of 1 897 askings account for 2 269 of 2 317 ms.

The texture lane has a different and bigger problem. texture refreshes per frame, all threads:

window 1 window 2 window 3
total 1 686 ms 1 862 ms 4 112 ms
asking the write watch and the guards 485 ms 26 ms 27 ms
waiting for title memory to hold still (the runtime remapping it) 1 197 ms 1 830 ms 4 076 ms

Nearly the whole texture lane, and in the worst frame 4.1 s of a 7.4 s frame, is the wait for title memory to stop being remapped — not copying, not hashing, not asking. That is also what @⁠peeepy reported from an RTX 3090 ("mostly waiting for title memory to hold still"), so it is not an AMD-only shape. Nothing in the copy path can fix that; it is the title remapping pages under a reader, and the interesting question is whether the layer can read those pages without asking for the mapping to hold still.

Two consequences for the priorities in this issue:

  1. The VICTORY_WINDOW_KB/VICTORY_ASK_ONCE family targets the right lane, but the tail suggests the win is not smaller windows — it is not asking per range at all, or asking from a thread that can afford to wait 365 ms. A single asking blocking the submitting thread for 0.4–0.75 s sets the frame time.
  2. The texture wait deserves its own item: it is bigger than everything else in the worst frames here, and it is not addressed by any current PR.

I have the full log if a specific line would help; nothing from the title is in it.

**@⁠rostaddotcc** on GitHub · 2026-11-24 21:49 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7145428819) Ran the counters the diagnostics build already has, on the loading/streaming phase here (RX 7900 XT/RDNA3, RADV, Proton Experimental, fork `4e17478`, diag build, no new switches — `VICTORY_NO_WATCHDOG=1 VICTORY_SHADER_LOOP_LIMIT=256` and the `d3d12` override). Three minutes, frames 5 511–8 157 ms, GPU 87–195 ms, 1 777–5 292 draws. This closes the "what is inside the copy lane" question that my earlier comment left open. **Per frame, from `copies per frame` and `recording per frame`:** The counters print per window between two frame lines, so these are the last two windows of the run, not two chosen frames: | | window 1 (last) | window 2 | |---|---:|---:| | `copies` (frame line) | 2 664 ms | 2 019 ms | | write-watch askings (`watches`) | 2 317 ms | 1 055 ms | | bytes asked about / unchanged | 7.58 GB / 7.44 GB (98.1 %) | 15.7 GB / 15.5 GB (98.8 %) | | of which askings ≥ 1 ms | 326 calls → **2 269 ms**, longest **365 ms** | 115 calls → 612 ms | | guard-fault time (`guards`) | 1 264 ms | 629 ms | | sparse reads (`sparse reads`) | 286 ms | 208 ms | | bulk kernel moves (`moves`) | 65 ms | 75 ms | | fallbacks / guard faults | 48 / 146 | 104 / 230 | So the lane that was 56–73 % "unattributed" is now attributed: asking + guards + sparse + moves account for essentially all of it, and **asking dominates at ~50–85 %**, with the single worst asking pinning the frame twice in this run: a 365 ms `GetWriteWatch`, and in one earlier frame **748 ms**. On a runtime whose mapped reads run at 21 GB/s, a 748 ms asking is not moving bytes — it is waiting for something. The shape is a long tail, not a uniform cost: 326 of 1 897 askings account for 2 269 of 2 317 ms. **The texture lane has a different and bigger problem.** `texture refreshes per frame, all threads`: | | window 1 | window 2 | window 3 | |---|---:|---:|---:| | total | 1 686 ms | 1 862 ms | 4 112 ms | | asking the write watch and the guards | 485 ms | 26 ms | 27 ms | | **waiting for title memory to hold still (the runtime remapping it)** | **1 197 ms** | **1 830 ms** | **4 076 ms** | Nearly the whole texture lane, and in the worst frame 4.1 s of a 7.4 s frame, is the wait for title memory to stop being remapped — not copying, not hashing, not asking. That is also what @⁠peeepy reported from an RTX 3090 ("mostly waiting for title memory to hold still"), so it is not an AMD-only shape. Nothing in the copy path can fix that; it is the title remapping pages under a reader, and the interesting question is whether the layer can read those pages without asking for the mapping to hold still. Two consequences for the priorities in this issue: 1. The `VICTORY_WINDOW_KB`/`VICTORY_ASK_ONCE` family targets the right lane, but the tail suggests the win is not smaller windows — it is not asking per range at all, or asking from a thread that can afford to wait 365 ms. A single asking blocking the submitting thread for 0.4–0.75 s sets the frame time. 2. The texture wait deserves its own item: it is bigger than everything else in the worst frames here, and it is not addressed by any current PR. I have the full log if a specific line would help; nothing from the title is in it.
Author
Owner

@⁠rocobalt1 on GitHub · 2026-11-24 22:03 UTC · original

The same counters from a Windows host, for the same four lanes, on a normal run (no VICTORY_GPU_TIMING). It splits your two readings: the asking tail looks Wine-specific here, the hold-still wait does not.

Setup: RTX 4060 Ti 8 GB, driver 32.0.16.1656, Ryzen 9 5900X, Windows 11; fork 4e17478, diag build, VICTORY_NO_WATCHDOG=1, VICTORY_SHADER_LOOP_LIMIT=32, --console series-x, VICTORY_DISPLAY_MODE=1920x1080, fresh data dir, ~7 minutes in the world. TdrDelay=60/TdrDdiDelay=60 machine-wide. 220 texture refreshes per frame lines and 81 write-watch askings lines in the log.

your RDNA3 / Wine this 4060 Ti / Windows
longest asking, per window 365 - 748 ms avg 2.2 ms, max 34.7 ms (n=81)
askings >= 1 ms 326 of 1 897 -> 2 269 ms 0 - 0.5 a frame, 0.5 ms, longest 1.1 ms
GetWriteWatch bytes asked about 7.6 - 15.7 GB a frame not printed on this build
waiting for title memory to hold still 1 197 - 4 076 ms avg 183 ms, max 2 073 ms, min 0 (n=220)
texture refreshes, all threads 1 686 - 4 112 ms 1.4 - 26 ms typical, one 322 ms spike
copies (frame line) 1 645 - 3 173 ms 46 - 87 ms

A representative copies per frame line from the same run:

45.3 submissions; 20383 title copies 9.8 MB; 29194 refreshes 22472.2 MB, 0 skipped 0.0 MB; 58 runs 0.0 ms; 0 queries 0.00 ms

So the two costs behave differently across the two hosts:

  • The asking tail is yours. A 365 - 748 ms GetWriteWatch has no counterpart here; ours are 1 ms with a 34.7 ms worst case in a whole run. That fits syscall emulation rather than the layer's asking strategy, which is the hypothesis you could not isolate.
  • The hold-still wait is not yours. On Windows, of the texture refreshes total, 183 ms a frame on average and up to 2 073 ms is also waiting for title memory to hold still. That is not copying, hashing or asking, and it is on the same build you and @⁠peeepy measured, so the item you asked to be filed separately has a second, non-Linux data point.

And you are right about the switch. My per-pipeline table (144 pipelines, 381 ms summed) was taken with VICTORY_GPU_TIMING=1, so that run described wait stage 0 rather than the stage a normal run resolves. The frame-line numbers I quoted in the issue (656 ms at 4K, 621 ms at 1080p, 340 - 373 ms for series-s) come from runs without the switch and stand as they are. I have not re-taken the per-pipeline table with the stage printed; that is the honest gap.

I am starting the two A/Bs you proposed on this machine now (VICTORY_ASK_ONCE=0 and VICTORY_COPY_MODE=none) and will post what they give.

No game data; counts only.

**@⁠rocobalt1** on GitHub · 2026-11-24 22:03 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7145755893) The same counters from a Windows host, for the same four lanes, on a normal run (no `VICTORY_GPU_TIMING`). It splits your two readings: the asking tail looks Wine-specific here, the hold-still wait does not. **Setup:** RTX 4060 Ti 8 GB, driver 32.0.16.1656, Ryzen 9 5900X, Windows 11; fork `4e17478`, diag build, `VICTORY_NO_WATCHDOG=1`, `VICTORY_SHADER_LOOP_LIMIT=32`, `--console series-x`, `VICTORY_DISPLAY_MODE=1920x1080`, fresh data dir, ~7 minutes in the world. `TdrDelay=60`/`TdrDdiDelay=60` machine-wide. 220 `texture refreshes per frame` lines and 81 `write-watch askings` lines in the log. | | your RDNA3 / Wine | **this 4060 Ti / Windows** | |---|---:|---:| | longest asking, per window | 365 - **748 ms** | avg **2.2 ms**, max **34.7 ms** (n=81) | | askings >= 1 ms | 326 of 1 897 -> 2 269 ms | **0 - 0.5 a frame, 0.5 ms**, longest 1.1 ms | | `GetWriteWatch` bytes asked about | 7.6 - 15.7 GB a frame | not printed on this build | | **waiting for title memory to hold still** | 1 197 - **4 076 ms** | **avg 183 ms, max 2 073 ms, min 0** (n=220) | | texture refreshes, all threads | 1 686 - 4 112 ms | 1.4 - 26 ms typical, one 322 ms spike | | copies (frame line) | 1 645 - 3 173 ms | 46 - 87 ms | A representative `copies per frame` line from the same run: ``` 45.3 submissions; 20383 title copies 9.8 MB; 29194 refreshes 22472.2 MB, 0 skipped 0.0 MB; 58 runs 0.0 ms; 0 queries 0.00 ms ``` So the two costs behave differently across the two hosts: - **The asking tail is yours.** A 365 - 748 ms `GetWriteWatch` has no counterpart here; ours are 1 ms with a 34.7 ms worst case in a whole run. That fits syscall emulation rather than the layer's asking strategy, which is the hypothesis you could not isolate. - **The hold-still wait is not yours.** On Windows, of the `texture refreshes` total, 183 ms a frame on average and up to 2 073 ms is also waiting for title memory to hold still. That is not copying, hashing or asking, and it is on the same build you and @⁠peeepy measured, so the item you asked to be filed separately has a second, non-Linux data point. **And you are right about the switch.** My per-pipeline table (144 pipelines, 381 ms summed) was taken with `VICTORY_GPU_TIMING=1`, so that run described wait stage 0 rather than the stage a normal run resolves. The frame-line numbers I quoted in the issue (`656 ms` at 4K, `621 ms` at 1080p, `340 - 373 ms` for `series-s`) come from runs without the switch and stand as they are. I have not re-taken the per-pipeline table with the stage printed; that is the honest gap. I am starting the two A/Bs you proposed on this machine now (`VICTORY_ASK_ONCE=0` and `VICTORY_COPY_MODE=none`) and will post what they give. No game data; counts only.
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-24 22:14 UTC · original

Follow-up on the texture lane I flagged above, now measured in three runs: the whole of it is the wait for the mapping lock, and VICTORY_TEXTURE_NO_WAIT=1 takes it to zero (median 20.2 ms -> 0.0 ms, max 4 076 ms -> 0.0 ms over 94 windows), while 0-2 textures a frame are left for the next refresh. I also tested and discarded my own theory that our readers were holding the lock too long - releasing it after the copy changes nothing. Details, numbers and the proposal: #178.

**@⁠rostaddotcc** on GitHub · 2026-11-24 22:14 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7145973892) Follow-up on the texture lane I flagged above, now measured in three runs: the whole of it is the wait for the mapping lock, and `VICTORY_TEXTURE_NO_WAIT=1` takes it to zero (median 20.2 ms -> 0.0 ms, max 4 076 ms -> 0.0 ms over 94 windows), while 0-2 textures a frame are left for the next refresh. I also tested and discarded my own theory that our readers were holding the lock too long - releasing it after the copy changes nothing. Details, numbers and the proposal: #178.
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-25 06:37 UTC · original

A negative result on the obvious lever, measured on Linux/Proton (RX 7900 XT, RADV, vkd3d-proton 3.2.0, latest main 8dd30ab, 400-second runs, comparable phases: median frame 2 279 ms against 2 452 ms).

Smaller windows do not help: they cut the bytes checked five-fold and double the call count.

default (4 MiB grid) VICTORY_WINDOW_KB=64
write-watch askings per window, median 1 746 3 705
…worst 5 182 22 728
bytes checked per window, median 7 336 MB 1 457 MB
…worst 18 049 MB 18 367 MB
watch time, median / worst 618 / 5 327 ms 712 / 7 567 ms
texture lane, median / worst 59 / 5 460 ms 20 / 3 625 ms
frame, median 2 279 ms 2 452 ms

So the bytes were never the cost — the calls are. Halving the range per call buys 5x fewer bytes and pays for it with 2.1x the calls, and the lane ends up slightly worse, with a much worse tail. The same conclusion the texture lane reached: with #175 the wait goes to 0 and what is left is asking (62.9 ms median, 936 ms worst) — per-call overhead again, which is what batching (#177) addresses for the texture path.

What this does suggest is a lever the tree does not have yet: the asking is per range, and on this box one frame asks about 7.3 GB across ~1 750 calls to find 186 MB of changes. A per-buffer ask that covers the buffer once (rather than one ask per submitted range) would cut both counts; VICTORY_ASK_ONCE already collapses the submission dimension, but each range inside a submission still gets its own call. If someone wants a target, that is the one I would measure next.

Two side notes from the same pair of runs: the texture lane improved with the smaller grid (59 to 20 ms total, wait 44 to 8 ms median) because each texture's own extent then covers fewer pages — so if anything the grid should shrink for textures and stay 4 MiB for buffers, which is not how the switch works today (one setting for both).

**@⁠rostaddotcc** on GitHub · 2026-11-25 06:37 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7154994278) A negative result on the obvious lever, measured on Linux/Proton (RX 7900 XT, RADV, vkd3d-proton 3.2.0, latest `main` `8dd30ab`, 400-second runs, comparable phases: median frame 2 279 ms against 2 452 ms). **Smaller windows do not help: they cut the bytes checked five-fold and double the call count.** | | default (4 MiB grid) | `VICTORY_WINDOW_KB=64` | |---|---:|---:| | write-watch askings per window, median | 1 746 | **3 705** | | …worst | 5 182 | **22 728** | | bytes checked per window, median | 7 336 MB | **1 457 MB** | | …worst | 18 049 MB | 18 367 MB | | watch time, median / worst | 618 / 5 327 ms | 712 / **7 567 ms** | | texture lane, median / worst | 59 / 5 460 ms | 20 / 3 625 ms | | frame, median | 2 279 ms | 2 452 ms | So the bytes were never the cost — the **calls** are. Halving the range per call buys 5x fewer bytes and pays for it with 2.1x the calls, and the lane ends up slightly worse, with a much worse tail. The same conclusion the texture lane reached: with #175 the wait goes to 0 and what is left is asking (62.9 ms median, 936 ms worst) — per-call overhead again, which is what batching (#177) addresses for the texture path. What this does suggest is a lever the tree does not have yet: **the asking is per range, and on this box one frame asks about 7.3 GB across ~1 750 calls to find 186 MB of changes.** A per-buffer ask that covers the buffer once (rather than one ask per submitted range) would cut both counts; `VICTORY_ASK_ONCE` already collapses the *submission* dimension, but each range inside a submission still gets its own call. If someone wants a target, that is the one I would measure next. Two side notes from the same pair of runs: the texture lane improved with the smaller grid (59 to 20 ms total, wait 44 to 8 ms median) because each texture's own extent then covers fewer pages — so if anything the grid should shrink for *textures* and stay 4 MiB for *buffers*, which is not how the switch works today (one setting for both).
Author
Owner

@⁠iGoldenNinja on GitHub · 2026-11-25 06:47 UTC · original · edited 2026-11-25 07:04 UTC

I checked the two program hashes in your resolution and ray-traversal question. Both bind and create host pipelines in our prison runs on an RTX 5080 / 617.14, Windows 11 Pro build 26200.9974, NVIDIA fork 310c6eb and the tested local 7e7bb18 diagnostics branch. I matched both guest inputs and disassembled them with 8dd30ab.

  • 6d7fe7745ab9c6d8 is a 32 × 1 × 1 Wave32 group with seven static image_bvh64_intersect_ray instructions among 9,416 decoded rows.
  • cfd83392ec9ae408 is an 8 × 4 × 1 Wave32 group with 250 decoded rows, including image and formatted buffer operations, and zero BVH opcodes.

These are offline instruction counts. The 5080 per-dispatch timing and resolution scaling remain open. Local test method and counts

OpenAI Codex (GPT-6) performed the matching and wrote the report.

RTX 5080 timing follow-up. I ran the same local 8dd30ab diagnostics binary with VICTORY_GPU_TIMING=1, warmed shader cache, reported mode 3840 × 2160, and the default shader loop limit. The camera responded in the prison. 5cf00dc39042edaf ranked first in all 12 prison timing windows at 12.30–13.91 ms/frame, longest dispatch 15.30 ms. Its matched native program is a checkerboard shadow-mask pass by container metadata and has zero decoded BVH intersection opcodes. cb6adcc6da2613ff was present in all 12 at 2.02–2.89 ms/frame.

The two original hashes bound. 6d7fe7745ab9c6d8 logged 0.36 and 0.73 ms/frame in two opening-sequence windows. Neither original hash appeared in the top 40 in the prison windows, so their prison costs remain unresolved. Timestamp method and limits

**@⁠iGoldenNinja** on GitHub · 2026-11-25 06:47 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7155153702) · edited 2026-11-25 07:04 UTC I checked the two program hashes in your resolution and ray-traversal question. Both bind and create host pipelines in our prison runs on an RTX 5080 / 617.14, Windows 11 Pro build 26200.9974, NVIDIA fork `310c6eb` and the tested local `7e7bb18` diagnostics branch. I matched both guest inputs and disassembled them with `8dd30ab`. - `6d7fe7745ab9c6d8` is a 32 × 1 × 1 Wave32 group with seven static `image_bvh64_intersect_ray` instructions among 9,416 decoded rows. - `cfd83392ec9ae408` is an 8 × 4 × 1 Wave32 group with 250 decoded rows, including image and formatted buffer operations, and zero BVH opcodes. These are offline instruction counts. The 5080 per-dispatch timing and resolution scaling remain open. [Local test method and counts](https://github.com/iGoldenNinja/victory-fork/blob/cbba548b827eec4246b1e6fde5477f08c1f4dd03/docs/world-compute-priority-5080.md) OpenAI Codex (GPT-6) performed the matching and wrote the report. **RTX 5080 timing follow-up.** I ran the same local `8dd30ab` diagnostics binary with `VICTORY_GPU_TIMING=1`, warmed shader cache, reported mode 3840 × 2160, and the default shader loop limit. The camera responded in the prison. `5cf00dc39042edaf` ranked first in all 12 prison timing windows at 12.30–13.91 ms/frame, longest dispatch 15.30 ms. Its matched native program is a checkerboard shadow-mask pass by container metadata and has zero decoded BVH intersection opcodes. `cb6adcc6da2613ff` was present in all 12 at 2.02–2.89 ms/frame. The two original hashes bound. `6d7fe7745ab9c6d8` logged 0.36 and 0.73 ms/frame in two opening-sequence windows. Neither original hash appeared in the top 40 in the prison windows, so their prison costs remain unresolved. [Timestamp method and limits](https://github.com/iGoldenNinja/victory-fork/blob/5945edf8e7a04c5cbfb34afdc9e4ed4b169293f4/docs/world-compute-priority-5080.md)
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-25 07:23 UTC · original

A follow-up that is good news for the copy lane, and the first A/B I have done on this ground that survived the phase problem: a26859f copies two to almost three times faster than 8dd30ab at matched draw counts on Linux/Proton (RX 7900 XT, RADV, vkd3d-proton 3.2.0, both runs entering the world with scripted keys, ~7 minutes each).

Bucketed by draws in the frame, median over the windows in the bucket:

draws a frame 8dd30ab copies a26859f copies bytes
1 000–2 000 1 006 ms 498 ms 241 → 173 MB
2 000–4 000 1 184 ms 539 ms 282 → 210 MB
4 000–9 000 959 ms 345 ms 299 → 274 MB

Frame time over the same buckets: 4 684 → 2 367 ms, 3 382 → 2 420 ms, 3 518 → 3 791 ms — so the world frames are not uniformly faster (the heaviest bucket is slightly worse), but the copy lane itself is cheaper everywhere, and it is no longer the thing that eats the second half of the frame at low draw counts.

Worth saying because it is a change nobody labelled as a copy-path change: "views off their copy's elements get their own bytes" and the descriptor records being mirrored are correctness work, and on this ground they came with a substantially cheaper lane. If that was intended, this is the measurement that says so; if it was not, it is worth knowing before someone "optimises" it back.

Two notes on method, since both have bitten me here:

  • Run with VICTORY_KEYS (diagnostics build) or the title sits at its start screen indefinitely — 30 fps, 13 draws, no error — and a run that never entered the world looks exactly like a loading regression. Details in #179.
  • Draws are the bucket, not time: the two commits hit different points in streaming, and comparing "first two minutes" compares different scenes.
**@⁠rostaddotcc** on GitHub · 2026-11-25 07:23 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7155815513) A follow-up that is good news for the copy lane, and the first A/B I have done on this ground that survived the phase problem: `a26859f` copies **two to almost three times faster** than `8dd30ab` at matched draw counts on Linux/Proton (RX 7900 XT, RADV, vkd3d-proton 3.2.0, both runs entering the world with scripted keys, ~7 minutes each). Bucketed by draws in the frame, median over the windows in the bucket: | draws a frame | `8dd30ab` copies | `a26859f` copies | bytes | |---|---:|---:|---:| | 1 000–2 000 | 1 006 ms | **498 ms** | 241 → 173 MB | | 2 000–4 000 | 1 184 ms | **539 ms** | 282 → 210 MB | | 4 000–9 000 | 959 ms | **345 ms** | 299 → 274 MB | Frame time over the same buckets: 4 684 → 2 367 ms, 3 382 → 2 420 ms, 3 518 → **3 791 ms** — so the world frames are not uniformly faster (the heaviest bucket is slightly worse), but the copy lane itself is cheaper everywhere, and it is no longer the thing that eats the second half of the frame at low draw counts. Worth saying because it is a change nobody labelled as a copy-path change: "views off their copy's elements get their own bytes" and the descriptor records being mirrored are correctness work, and on this ground they came with a substantially cheaper lane. If that was intended, this is the measurement that says so; if it was not, it is worth knowing before someone "optimises" it back. Two notes on method, since both have bitten me here: - **Run with `VICTORY_KEYS`** (diagnostics build) or the title sits at its start screen indefinitely — 30 fps, 13 draws, no error — and a run that never entered the world looks exactly like a loading regression. Details in #179. - Draws are the bucket, not time: the two commits hit different points in streaming, and comparing "first two minutes" compares different scenes.
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-25 08:14 UTC · original

⚠️ Retracting the table above (the "a26859f copies two to almost three times faster at matched draws" one, comment 7155815513). I repeated the comparison and it does not survive repetition, so please do not plan anything on it.

The run-to-run spread on this ground is larger than the difference I was reporting. Three runs of the same script, all entering the world with scripted keys, same box, same prefix, minutes apart — and two of them are the same binary:

draws a frame 9376fd6 run 1 a26859f 9376fd6 run 2
1 000–2 000 3 922 ms / copies 601 2 154 / 370 2 003 / 372
2 000–3 000 3 727 / 1 165 4 057 / 1 420 2 009 / 304
3 000+ 6 731 / 1 008 3 914 / 618 1 707 / 197

9376fd6 against itself: 3 922 vs 2 003 ms and 601 vs 372 ms of copies in the first bucket, 6 731 vs 1 707 and 1 008 vs 197 in the last — a factor of two to four between identical binaries. That is the whole size of the effect I reported, so the honest reading is no measured difference between the two commits, in either direction. (And the same caveat applies to my earlier note that 9376fd6 looked twice as slow: that was one run, and it does not reproduce.)

Draw count is not a sufficient phase control here: two windows with 2 200 draws can be in different places of the streaming, with different amounts of new content. Nor is it the shader cache — the translation counts are flat across the three runs (2 693, 2 692, 2 743) against a 1.7 GB cache.

What would make a comparison trustworthy on this ground: three or more runs alternating A/B/A/B, taking medians across runs rather than inside one, and bucketing on something that tracks content (bytes copied, new pipelines, MB of textures refreshed) rather than on draws alone. I will bring numbers in that shape or not bring them.

**@⁠rostaddotcc** on GitHub · 2026-11-25 08:14 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7156790682) ⚠️ **Retracting the table above** (the "`a26859f` copies two to almost three times faster at matched draws" one, comment 7155815513). I repeated the comparison and it does not survive repetition, so please do not plan anything on it. The run-to-run spread on this ground is larger than the difference I was reporting. Three runs of the same script, all entering the world with scripted keys, same box, same prefix, minutes apart — and two of them are **the same binary**: | draws a frame | `9376fd6` run 1 | `a26859f` | `9376fd6` run 2 | |---|---:|---:|---:| | 1 000–2 000 | 3 922 ms / copies 601 | 2 154 / 370 | **2 003 / 372** | | 2 000–3 000 | 3 727 / 1 165 | 4 057 / 1 420 | **2 009 / 304** | | 3 000+ | 6 731 / 1 008 | 3 914 / 618 | **1 707 / 197** | `9376fd6` against itself: 3 922 vs 2 003 ms and 601 vs 372 ms of copies in the first bucket, 6 731 vs 1 707 and 1 008 vs 197 in the last — a factor of two to four between identical binaries. That is the whole size of the effect I reported, so the honest reading is **no measured difference between the two commits**, in either direction. (And the same caveat applies to my earlier note that `9376fd6` looked twice as slow: that was one run, and it does not reproduce.) Draw count is not a sufficient phase control here: two windows with 2 200 draws can be in different places of the streaming, with different amounts of new content. Nor is it the shader cache — the translation counts are flat across the three runs (2 693, 2 692, 2 743) against a 1.7 GB cache. What would make a comparison trustworthy on this ground: **three or more runs alternating A/B/A/B**, taking medians across runs rather than inside one, and bucketing on something that tracks content (bytes copied, new pipelines, MB of textures refreshed) rather than on draws alone. I will bring numbers in that shape or not bring them.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-25 08:50 UTC · original · edited 2026-11-25 09:22 UTC

@⁠rostaddotcc I used PortBridge preflight to find this thread and ran a small native Windows 11 control for the range-narrowing question. Across eight alternating pairs with sparse writes, joining eight contiguous 4 MiB ranges cut median paired query time by 39.7%. Joining eight alternating ranges across their gaps raised it by 13.3%.

There is a correctness check worth carrying into a Proton A/B. One enclosing GetWriteWatch query with the reset flag returned the 155 requested pages plus 135 dirty gap pages. The call consumed those observations, and a later gap query found zero. The current journal correctly records every returned page. A contiguous-only arm could test both grouping stages while keeping that journal behavior.

Reproducer and raw data. These numbers describe the native Windows API on synthetic memory. Proton, game-frame time and GPU behavior need separate measurements.

I added an opt-in arm to the pinned 9376fd6 code for a paired follow-up. It uses the original refresh ranges and coalesces only touching pages, while keeping the default grouping and journal behavior. All 14 watch::tests passed on Windows, including a native check that the gap page remains visible to the next kernel read. This makes the experiment reproducible for a Proton A/B. The native test keeps a separate journal and all checks passed 48 repeated suites across one and four test threads. The switch only changes submission prefetch. Later fallback queries can still cover wider spans. No frame or GPU performance was measured. Patch and verification.

**@⁠akimfomin** on GitHub · 2026-11-25 08:50 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7157543744) · edited 2026-11-25 09:22 UTC @⁠rostaddotcc I used [PortBridge](https://github.com/akimfomin/PortBridge) preflight to find this thread and ran a small native Windows 11 control for the range-narrowing question. Across eight alternating pairs with sparse writes, joining eight contiguous 4 MiB ranges cut median paired query time by 39.7%. Joining eight alternating ranges across their gaps raised it by 13.3%. There is a correctness check worth carrying into a Proton A/B. One enclosing `GetWriteWatch` query with the reset flag returned the 155 requested pages plus 135 dirty gap pages. The call consumed those observations, and a later gap query found zero. The current journal correctly records every returned page. A contiguous-only arm could test both grouping stages while keeping that journal behavior. [Reproducer and raw data](https://github.com/akimfomin/PortBridge/tree/f0f956653d81ff2d833db0e95394aef50193a2c3/research/victory-write-watch-control). These numbers describe the native Windows API on synthetic memory. Proton, game-frame time and GPU behavior need separate measurements. I added an opt-in arm to the pinned 9376fd6 code for a paired follow-up. It uses the original refresh ranges and coalesces only touching pages, while keeping the default grouping and journal behavior. All 14 `watch::tests` passed on Windows, including a native check that the gap page remains visible to the next kernel read. This makes the experiment reproducible for a Proton A/B. The native test keeps a separate journal and all checks passed 48 repeated suites across one and four test threads. The switch only changes submission prefetch. Later fallback queries can still cover wider spans. No frame or GPU performance was measured. [Patch and verification](https://github.com/akimfomin/PortBridge/tree/86a3f2cb35b9aa398840ed92a27fef2add7f6e47/research/victory-write-watch-control/integration).
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-25 22:40 UTC · original

I checked the viewport sizes under both display settings on an RX 7900 XT (RADV 26.3.1, Wine 11.22). With the Series X profile I changed both the reported mode and the fullscreen setting in a separate settings directory to 1920×1080. The title saw the 1080p mode. It still created a 3840×2160 swapchain.

I sampled one graphics viewport per 257 binds on the same first-room route. The two most frequent sizes were 2560×1440 and 2048×2048 in both runs. The 4K setting gave 655 successful presents in 73.82 s (8.87 FPS, 4,854 draws/frame). The 1080p setting gave 555 in 73.22 s (7.58 FPS, 4,870 draws/frame). Single runs with a sampling build; the room rendered in the captured output.

For anyone comparing fill cost here, changing the display mode alone didn’t give this pair four times fewer scene pixels. Checking the graphics viewports alongside the swapchain makes that distinction visible.

**@⁠UwUCammie** on GitHub · 2026-11-25 22:40 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7176659252) I checked the viewport sizes under both display settings on an RX 7900 XT (RADV 26.3.1, Wine 11.22). With the Series X profile I changed both the reported mode and the fullscreen setting in a separate settings directory to 1920×1080. The title saw the 1080p mode. It still created a 3840×2160 swapchain. I sampled one graphics viewport per 257 binds on the same first-room route. The two most frequent sizes were 2560×1440 and 2048×2048 in both runs. The 4K setting gave 655 successful presents in 73.82 s (8.87 FPS, 4,854 draws/frame). The 1080p setting gave 555 in 73.22 s (7.58 FPS, 4,870 draws/frame). Single runs with a sampling build; the room rendered in the captured output. For anyone comparing fill cost here, changing the display mode alone didn’t give this pair four times fewer scene pixels. Checking the graphics viewports alongside the swapchain makes that distinction visible.
Author
Owner

@⁠xilorezer on GitHub · 2026-11-25 23:38 UTC · original

One possible direction worth investigating is a more aggressive optimization of the CPU submission path and GPU workload scheduling.

A few techniques commonly used in modern game engines might be relevant here:

1. CPU-side command preparation

  • Reduce redundant pipeline and descriptor lookups.
  • Cache or reuse root descriptor tables and command state where valid.
  • Reduce per-command validation and bookkeeping overhead.
  • Identify opportunities to prepare independent command lists in parallel.

2. GPU-driven execution

  • Investigate whether some CPU-side command preparation can be moved to GPU-side compute passes.
  • Use indirect execution where the workload and existing command structure allow it.
  • Avoid introducing additional synchronization or barriers that would cost more than the work being removed.

3. Compute shader optimization

  • Profile the most expensive indirect compute pipelines individually.
  • Investigate whether expensive passes can be simplified, merged, or executed at a lower resolution where their output permits it.
  • Look for redundant memory accesses, unnecessary dispatches, and avoidable synchronization.

4. Better workload profiling

  • Separate CPU command-recording time, submission time, GPU execution time, and synchronization waits.
  • Identify whether the 82 ms host-list preparation cost is concentrated in pipeline lookup, descriptor management, resource tracking, or another per-command operation.

I realize that this is a compatibility layer rather than a conventional game engine, so batching and command restructuring must preserve the original Xbox execution semantics.

The goal here would mainly be to reduce the overhead of preparing and executing the existing workload.

Would it be compatible with the current architecture, particularly the host-list preparation bottleneck?

**@⁠xilorezer** on GitHub · 2026-11-25 23:38 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7177852180) One possible direction worth investigating is a more *aggressive* optimization of the CPU submission path and GPU workload scheduling. A few techniques commonly used in modern game engines might be relevant here: **1. CPU-side command preparation** - Reduce redundant pipeline and descriptor lookups. - Cache or reuse root descriptor tables and command state where valid. - Reduce per-command validation and bookkeeping overhead. - Identify opportunities to prepare independent command lists in parallel. **2. GPU-driven execution** - Investigate whether some CPU-side command preparation can be moved to GPU-side compute passes. - Use indirect execution where the workload and existing command structure allow it. - Avoid introducing additional synchronization or barriers that would cost more than the work being removed. **3. Compute shader optimization** - Profile the most expensive indirect compute pipelines individually. - Investigate whether expensive passes can be simplified, merged, or executed at a lower resolution where their output permits it. - Look for redundant memory accesses, unnecessary dispatches, and avoidable synchronization. **4. Better workload profiling** - Separate CPU command-recording time, submission time, GPU execution time, and synchronization waits. - Identify whether the 82 ms host-list preparation cost is concentrated in pipeline lookup, descriptor management, resource tracking, or another per-command operation. **I realize that this is a compatibility layer rather than a conventional game engine, so batching and command restructuring must preserve the original Xbox execution semantics.** The goal here would mainly be to reduce the overhead of preparing and executing the existing workload. Would it be compatible with the current architecture, particularly the host-list preparation bottleneck?
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-26 00:47 UTC · original

Tried the alternating gather mode from 006c353 on an RX 7900 XT with Wine 11.22 and RADV 26.3.1. In the first room, gathering at copy time gave 698 accepted presents in 104.62 s (6.67 FPS). With it off I counted 701 in 106.06 s (6.61 FPS). Both private checks showed the character and courtyard. The modes switched every 20 s in one run, and I excluded intervals crossing a switch and the first second after each switch. I’d leave the default alone on this evidence. Sampler and build

**@⁠UwUCammie** on GitHub · 2026-11-26 00:47 UTC · [original](https://github.com/fxceless/victory-fork/issues/10#issuecomment-7179121309) Tried the alternating gather mode from 006c353 on an RX 7900 XT with Wine 11.22 and RADV 26.3.1. In the first room, gathering at copy time gave 698 accepted presents in 104.62 s (6.67 FPS). With it off I counted 701 in 106.06 s (6.61 FPS). Both private checks showed the character and courtyard. The modes switched every 20 s in one run, and I excluded intervals crossing a switch and the first second after each switch. I’d leave the default alone on this evidence. [Sampler and build](https://github.com/UwUCammie/victory-amd/blob/ffaeea0/benchmarks/README.md#gathering-indirect-arguments-at-copy-time)
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#10
No description provided.