Fix the world-entry crash the table-slot skip causes; coalesce refreshes; opt-in readable-range copies #826

Open
traidy2222 wants to merge 11 commits from upstream-pr/827 into main
traidy2222 commented 2026-11-25 09:21:40 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by traidy2222 on 2026-11-25T09:21:40Z.


What this is

Three small, behaviour-preserving changes to the processor side of the frame,
written while running the title on a 16 GB / RTX 3080 box, plus the one thing
they found: the descriptor-sync skip window crashes the title at world entry,
and the window is the cause, not the skipping.

Measured on: i7-12700F, 16 GB DDR4, RTX 3080 10 GB, Windows 11, Series X
profile, build 9376fd6 + these changes. Same scene (frames with >= 1500
draws), medians:

configuration frame copies copy rate GPU fps
a26859f + the README's speed switches 2885 ms 709 ms / 216 MB 305 MB/s 131 ms 0.35
9376fd6 + switches + VICTORY_HEAP_SYNC_TABLES=1 2101 ms 581 ms / 380 MB 654 MB/s 100 ms 0.48
+ this branch (coalesced refreshes, COPY_FAST) 1261-1376 ms 244 ms / 210 MB 861 MB/s 94 ms 0.73-0.79

Loading into the world: 232 s (cold shader cache) -> 84 s (warm cache + these).

1. The world-entry crash: tabled_lately's 240-frame window

Three runs of 9376fd6 with no switches died at the same place, reproducibly:

unhandled exception 0xc0000005 at victory-image-<hash>.dll+0x23cf683
(write 0x0: nothing mapped there)          frames 2112, 2253, 2573

HostHeap::tabled_lately leaves a slot to its draws if it was a table's within
TABLED_FRAMES (240) frames, and does not ask whether a draw read it through
a table. A slot the title stops reading through a table keeps being skipped for
eight seconds, so a draw that now reads it directly gets a record no pass made.

VICTORY_TABLED_SKIP_FRAMES=<n> asks the stricter question: skip only if a
draw read the slot through a table within n frames (the read bit is
already in tabled). With =2: two clean runs through the world, no
exception; with the shipped window: three crashes. Unset keeps today's
behaviour exactly.

Note for the maintainer: the OOM report of the crash carries
memory.load_percent 94-97-99, so a slower run survives by reaching the wall
later; the window is still the thing that decides whether a skipped slot is
ever made.

2. Refreshes of one title buffer, coalesced

Batch::flush hands Shadow::update 25,000-90,000 ranges a frame of 11-21 KB
each (the new copies moved per frame line). Ranges of the same copy within
64 KB now become one call; the bytes between them are title memory as well, and
Shadow::update still cuts the merged range around what shaders write.
Result: 60-90k calls -> 24-50k for the same bytes.

3. VICTORY_COPY_FAST: a memcpy when the range is readable

copy_mapped reads title memory with ReadProcessMemory (600 MB/s here).
With the flag, a range the kernel reports readable is moved with the CPU:
700-1,300 MB/s measured. Off by default: the title can unmap a page between
the question and the copy (the page pool's pages move when streaming replaces
them) and a fault there kills the process. It needs a guarded copy (vectored
handler) before it can default on; until then it is an experiment, and it is
not needed by the crash fix.

4. watch::forgot, and one more thing it showed

The layer's own write-back into title memory sets the kernel's write-watch
dirty bits, so the next refresh reports them as the title's writes and copies
the same bytes up again. forgot resets them after the layer's write.
Measured: title-memory copies through this path are only 0.5-2.5 MB a frame,
so this is small; the 460-1,530 MB a frame of copies are in the texture queue.

Not in this PR, and the biggest number left

The pass over the heap still mirrors 34,483 records a frame at ~25 us each
(~250-800 ms). Skipping more of them is what makes it 3 ms and kills the
title; the window above only makes the skipping safe. Making a mirror cheap
(batch the view creation, cache by resource+description) is the next step, and
I have not written it.

The texture queue is the other: 18,333 slots due a frame against a 2 GB card
budget, uploaded, evicted, due again. Capping the stage
(VICTORY_TEXTURE_STAGE_MB=64) took a 1.5 s frame to 0.44-0.48 s; ordering the
queue by last use is the fix I would write next.

cargo test -p victory-gpu --lib: 142 passed, 2 failed
(pipeline::host::tests::a_mesh_pipeline_loads_from_the_library,
...::depth_bounds_pipeline_loads_and_filters_draws), both asserting the
pipeline library is loaded from rather than compiled again - they touch nothing
in this diff and fail the same way here on 9376fd6 without it.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6601227059 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827). Originally posted by [traidy2222](https://github.com/traidy2222) on 2026-11-25T09:21:40Z. --- ## What this is Three small, behaviour-preserving changes to the processor side of the frame, written while running the title on a 16 GB / RTX 3080 box, plus the one thing they found: **the descriptor-sync skip window crashes the title at world entry, and the window is the cause, not the skipping.** Measured on: i7-12700F, 16 GB DDR4, RTX 3080 10 GB, Windows 11, Series X profile, build `9376fd6` + these changes. Same scene (frames with >= 1500 draws), medians: | configuration | frame | copies | copy rate | GPU | fps | |---|---|---|---|---|---| | `a26859f` + the README's speed switches | 2885 ms | 709 ms / 216 MB | 305 MB/s | 131 ms | 0.35 | | `9376fd6` + switches + `VICTORY_HEAP_SYNC_TABLES=1` | 2101 ms | 581 ms / 380 MB | 654 MB/s | 100 ms | 0.48 | | + this branch (coalesced refreshes, `COPY_FAST`) | **1261-1376 ms** | 244 ms / 210 MB | **861 MB/s** | 94 ms | **0.73-0.79** | Loading into the world: 232 s (cold shader cache) -> 84 s (warm cache + these). ## 1. The world-entry crash: `tabled_lately`'s 240-frame window Three runs of `9376fd6` with no switches died at the same place, reproducibly: ``` unhandled exception 0xc0000005 at victory-image-<hash>.dll+0x23cf683 (write 0x0: nothing mapped there) frames 2112, 2253, 2573 ``` `HostHeap::tabled_lately` leaves a slot to its draws if it was a table's within `TABLED_FRAMES` (240) frames, and does not ask whether a draw *read* it through a table. A slot the title stops reading through a table keeps being skipped for eight seconds, so a draw that now reads it directly gets a record no pass made. `VICTORY_TABLED_SKIP_FRAMES=<n>` asks the stricter question: skip only if a draw read the slot **through a table** within `n` frames (the read bit is already in `tabled`). With `=2`: two clean runs through the world, no exception; with the shipped window: three crashes. Unset keeps today's behaviour exactly. Note for the maintainer: the OOM report of the crash carries `memory.load_percent` 94-97-99, so a slower run survives by reaching the wall later; the window is still the thing that decides whether a skipped slot is ever made. ## 2. Refreshes of one title buffer, coalesced `Batch::flush` hands `Shadow::update` 25,000-90,000 ranges a frame of 11-21 KB each (the new `copies moved per frame` line). Ranges of the same copy within 64 KB now become one call; the bytes between them are title memory as well, and `Shadow::update` still cuts the merged range around what shaders write. Result: 60-90k calls -> 24-50k for the same bytes. ## 3. `VICTORY_COPY_FAST`: a `memcpy` when the range is readable `copy_mapped` reads title memory with `ReadProcessMemory` (600 MB/s here). With the flag, a range the kernel reports readable is moved with the CPU: 700-1,300 MB/s measured. **Off by default**: the title can unmap a page between the question and the copy (the page pool's pages move when streaming replaces them) and a fault there kills the process. It needs a guarded copy (vectored handler) before it can default on; until then it is an experiment, and it is not needed by the crash fix. ## 4. `watch::forgot`, and one more thing it showed The layer's own write-back into title memory sets the kernel's write-watch dirty bits, so the next refresh reports them as the title's writes and copies the same bytes up again. `forgot` resets them after the layer's write. Measured: title-memory copies through this path are only 0.5-2.5 MB a frame, so this is small; the 460-1,530 MB a frame of copies are in the texture queue. ## Not in this PR, and the biggest number left The pass over the heap still mirrors **34,483 records a frame** at ~25 us each (~250-800 ms). Skipping more of them is what makes it 3 ms and kills the title; the window above only makes the skipping safe. Making a mirror cheap (batch the view creation, cache by resource+description) is the next step, and I have not written it. The texture queue is the other: 18,333 slots due a frame against a 2 GB card budget, uploaded, evicted, due again. Capping the stage (`VICTORY_TEXTURE_STAGE_MB=64`) took a 1.5 s frame to 0.44-0.48 s; ordering the queue by last use is the fix I would write next. `cargo test -p victory-gpu --lib`: 142 passed, 2 failed (`pipeline::host::tests::a_mesh_pipeline_loads_from_the_library`, `...::depth_bounds_pipeline_loads_and_filters_draws`), both asserting the pipeline library is loaded from rather than compiled again - they touch nothing in this diff and fail the same way here on `9376fd6` without it.
Lancito01 commented 2026-11-25 10:11:12 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Lancito01 on 2026-11-25T09:26:17Z.


One data point on the +0x23cf683 crash from my own test runs (same card: RTX 3080 10 GB, 32 GB RAM, Windows 11), in case it helps separate the window from memory pressure. One run, so a lead, not a result.

I got the same exception at the same offset on a tree that has no tabled_lately window at all: fork 310c6eb + #571, the #115 line, #51, #606, #112, #25, #644, #294, #646, #186, #648, #691, #544, #640, #489, #683, #220, launched with VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1.

unhandled exception 0xc0000005 at victory-image-<hash>.dll+0x23cf683 (write 0x0: nothing mapped there)

Context of that run:

  • It never left loading (12m45s, ~10 draws a frame, at "Prestream Metadata").
  • Right before it, the PC was out of commit: RAM 93% in use and only ~2.4 GB of ~73 GB commit left; the card's VRAM budget fell from 9.3 to 7.6 GB about 25 s earlier.
  • The same build without the builder (and a retry with the builder after freeing memory) got into the world without this crash.

So on this machine +0x23cf683 also appears with no skip window, at the point the system runs out of commit, which fits your note about memory.load_percent 94-99. It looks like the title's own reaction to a failed allocation, which the window can bring on, but not something only the window causes. That doesn't argue against VICTORY_TABLED_SKIP_FRAMES=2: your 3-crashes vs 2-clean comparison is on the same tree. It may just be worth logging commit headroom next to these crash reports.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7158328992 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7158328992). Originally posted by [Lancito01](https://github.com/Lancito01) on 2026-11-25T09:26:17Z. --- One data point on the `+0x23cf683` crash from my own test runs (same card: RTX 3080 10 GB, 32 GB RAM, Windows 11), in case it helps separate the window from memory pressure. One run, so a lead, not a result. I got the **same exception at the same offset** on a tree that has **no `tabled_lately` window** at all: fork `310c6eb` + #571, the #115 line, #51, #606, #112, #25, #644, #294, #646, #186, #648, #691, #544, #640, #489, #683, #220, launched with `VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1`. ``` unhandled exception 0xc0000005 at victory-image-<hash>.dll+0x23cf683 (write 0x0: nothing mapped there) ``` Context of that run: - It never left loading (12m45s, ~10 draws a frame, at "Prestream Metadata"). - Right before it, the PC was out of commit: RAM 93% in use and only ~2.4 GB of ~73 GB commit left; the card's VRAM budget fell from 9.3 to 7.6 GB about 25 s earlier. - The same build without the builder (and a retry with the builder after freeing memory) got into the world without this crash. So on this machine `+0x23cf683` also appears with no skip window, at the point the system runs out of commit, which fits your note about `memory.load_percent` 94-99. It looks like the title's own reaction to a failed allocation, which the window can bring on, but not something only the window causes. That doesn't argue against `VICTORY_TABLED_SKIP_FRAMES=2`: your 3-crashes vs 2-clean comparison is on the same tree. It may just be worth logging commit headroom next to these crash reports.
MamaLeVrai commented 2026-11-25 10:11:14 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T09:54:01Z.


Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head f681125 into main 9376fd6 in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails, with the same two errors as main itself on this machine (function placed_filler_twins is never used, field depth_written is never read, victory-gpu): this PR adds none and removes none. cargo test --workspace --locked: 540 passed, 0 failed, 10 ignored, two runs (main alone: 540 passed). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7158951162 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7158951162). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T09:54:01Z. --- Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `f681125` into `main` `9376fd6` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails, with the same two errors as `main` itself on this machine (`function placed_filler_twins is never used`, `field depth_written is never read`, `victory-gpu`): this PR adds none and removes none. `cargo test --workspace --locked`: 540 passed, 0 failed, 10 ignored, two runs (`main` alone: 540 passed). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
sagouindupm commented 2026-11-25 12:07:03 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by sagouindupm on 2026-11-25T11:33:45Z.


Tested this PR (f681125) together with #824 (9dae0a7) on Windows 11 Pro (Intel i5-12400F, 32 GB RAM, NVIDIA GeForce RTX 3050 8 GB) under --console series-s, compared against the same local base (9376fd6 + #188 + #518 + #610 + VICTORY_LITE=1280x5120, 20 window-title samples taken every ~10 s starting at 100 s):

  • Baseline (bench_k0): entered 3D draws (926 draws) at sample 10/20, peak frame time 2,357.9 ms/frame (sample 17/20), ended at 234.3 ms/frame (2711 draws, sample 20/20), interior walls intact.
  • With #827 + #824 combined (bench_k1): entered 3D draws (965 draws) at sample 2/20, max frame-time spike across all 20 samples dropped to 628.3 ms/frame (zero multi-second spikes), and the last 5 samples stabilized at 211.9–225.8 ms/frame (mean 218.5 ms/frame, ~4.6 FPS; log peak 4.9 fps / 205.2 ms/frame), interior walls intact.

(Note: #827 and #824 were measured together in the same build, so the speedup and spike reduction reflect their combined effect on 8 GB Windows hardware.)

AI-assisted: benchmark analysis and write-up prepared with AI assistance.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7161207384 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7161207384). Originally posted by [sagouindupm](https://github.com/sagouindupm) on 2026-11-25T11:33:45Z. --- Tested this PR (`f681125`) together with #824 (`9dae0a7`) on Windows 11 Pro (Intel i5-12400F, 32 GB RAM, NVIDIA GeForce RTX 3050 8 GB) under `--console series-s`, compared against the same local base (`9376fd6` + #188 + #518 + #610 + `VICTORY_LITE=1280x5120`, 20 window-title samples taken every ~10 s starting at 100 s): - **Baseline** (`bench_k0`): entered 3D draws (`926 draws`) at sample 10/20, peak frame time **2,357.9 ms/frame** (sample 17/20), ended at **234.3 ms/frame** (`2711 draws`, sample 20/20), interior walls intact. - **With #827 + #824 combined** (`bench_k1`): entered 3D draws (`965 draws`) at sample 2/20, max frame-time spike across all 20 samples dropped to **628.3 ms/frame** (zero multi-second spikes), and the last 5 samples stabilized at **211.9–225.8 ms/frame** (mean **218.5 ms/frame**, ~4.6 FPS; log peak **4.9 fps / 205.2 ms/frame**), interior walls intact. *(Note: #827 and #824 were measured together in the same build, so the speedup and spike reduction reflect their combined effect on 8 GB Windows hardware.)* AI-assisted: benchmark analysis and write-up prepared with AI assistance.
npanu420 commented 2026-11-25 13:06:02 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by npanu420 on 2026-11-25T12:41:09Z.


Data point on VICTORY_COPY_FAST=1, from an RTX 3070 8 GB + i9-9900X (Windows 11, Series S profile). This PR and #154 were merged onto ExoCalibra's d034ac1 (fork main f85101b), plus #809, #95 and #108.

The race your doc comment describes does happen in practice. In 1 of 3 launches with COPY_FAST=1, about 160 s in, during the first world frames:

unhandled exception 0xc0000005 at VCRUNTIME140.dll (memcpy) (read 0xa3b827240: reserved, never committed), length 0x378dc0, inside copy_mapped's fast branch.

The page passed the committed(src, len) check and was gone at the copy. There were no crashes in 7 launches without it.

Speed when it survives, median over world frames 60-400 (same build, single runs):

switches median latest frame preparing copies
defaults (DIRECT_COPY on) 277-295 ms ~190 ms ~32 ms / 81 MB
COPY_FAST=1 231-236 ms ~177 ms ~43 ms

So the fast path is worth about 50 ms here, but it needs fault-tolerant reads (or a guard against pages moving) before it can be on by default. Merging this PR alone (fast path off) already took our copies from 76 to about 32 ms a frame. Thanks!

(AI-assisted, Claude Code. No game data.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7162714019 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7162714019). Originally posted by [npanu420](https://github.com/npanu420) on 2026-11-25T12:41:09Z. --- Data point on `VICTORY_COPY_FAST=1`, from an RTX 3070 8 GB + i9-9900X (Windows 11, Series S profile). This PR and #154 were merged onto ExoCalibra's `d034ac1` (fork main `f85101b`), plus #809, #95 and #108. The race your doc comment describes does happen in practice. In 1 of 3 launches with `COPY_FAST=1`, about 160 s in, during the first world frames: `unhandled exception 0xc0000005 at VCRUNTIME140.dll (memcpy) (read 0xa3b827240: reserved, never committed)`, length `0x378dc0`, inside `copy_mapped`'s fast branch. The page passed the `committed(src, len)` check and was gone at the copy. There were no crashes in 7 launches without it. Speed when it survives, median over world frames 60-400 (same build, single runs): | switches | median | latest frame | preparing copies | |---|---|---|---| | defaults (`DIRECT_COPY` on) | 277-295 ms | ~190 ms | ~32 ms / 81 MB | | `COPY_FAST=1` | 231-236 ms | ~177 ms | ~43 ms | So the fast path is worth about 50 ms here, but it needs fault-tolerant reads (or a guard against pages moving) before it can be on by default. Merging this PR alone (fast path off) already took our copies from 76 to about 32 ms a frame. Thanks! (AI-assisted, Claude Code. No game data.)
ofc0urse commented 2026-11-25 13:06:03 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ofc0urse on 2026-11-25T12:50:36Z.


An A/B where this PR changed what reaches the screen, in case it helps narrow it down.

RTX 4060 Ti 8 GB (driver 621.24), i5-14400F, 32 GB, Windows 11, diagnostics build, --console series-s, VICTORY_TEXTURE_DROP_MIPS=1, VICTORY_TEXTURE_NO_WAIT=1, same automated walk into the first room, 13 minutes each. Both trees are f85101b + #610 + #802 + #798 + #834 + #823; the only difference is this PR's commits (5ff1ffb..0e2d5ab, clean cherry-picks).

with this PR without
textures picked by index, uploaded so far 18,402 (6,120 MB) 63,338 (27,235 MB)
still waiting 14,548 7,699
card in use / budget 4,962 / 7,181 MB 4,717 / 7,181 MB
settled ms/frame ~196 ~198

The card is well under budget in both, so room is not what holds the uploads back. In the captures with this PR the yard through the cell window has untextured ground, tables and chairs, and the cell stays dark; without it they are textured. On Series X the same pair gave 20,232 after 17 minutes with it against 48,803 after 10 minutes without.

I did not bisect inside the branch. My guess is 44694f4 (each view made once and copied into the slots that show it again) or the skip window, since both change which slots the by-index texture pass sees, but that is a guess.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:comment:7162933631 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7162933631). Originally posted by [ofc0urse](https://github.com/ofc0urse) on 2026-11-25T12:50:36Z. --- An A/B where this PR changed what reaches the screen, in case it helps narrow it down. RTX 4060 Ti 8 GB (driver 621.24), i5-14400F, 32 GB, Windows 11, diagnostics build, `--console series-s`, `VICTORY_TEXTURE_DROP_MIPS=1`, `VICTORY_TEXTURE_NO_WAIT=1`, same automated walk into the first room, 13 minutes each. Both trees are `f85101b` + #610 + #802 + #798 + #834 + #823; the only difference is this PR's commits (`5ff1ffb`..`0e2d5ab`, clean cherry-picks). | | with this PR | without | |---|---:|---:| | textures picked by index, uploaded so far | 18,402 (6,120 MB) | 63,338 (27,235 MB) | | still waiting | 14,548 | 7,699 | | card in use / budget | 4,962 / 7,181 MB | 4,717 / 7,181 MB | | settled ms/frame | ~196 | ~198 | The card is well under budget in both, so room is not what holds the uploads back. In the captures with this PR the yard through the cell window has untextured ground, tables and chairs, and the cell stays dark; without it they are textured. On Series X the same pair gave 20,232 after 17 minutes with it against 48,803 after 10 minutes without. I did not bisect inside the branch. My guess is `44694f4` (each view made once and copied into the slots that show it again) or the skip window, since both change which slots the by-index texture pass sees, but that is a guess. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
npanu420 commented 2026-11-25 14:10:53 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by npanu420 on 2026-11-25T14:01:08Z.


On the texture question above, a counter-point from a different tree. RTX 3070 8 GB, Series S, TEXTURE_NO_WAIT=1, without TEXTURE_DROP_MIPS.

The tree is ExoCalibra's d034ac1 + #809, #95, #108 + a port of #523 + fork main 0b0074e, with this PR and #154 merged or not. Six-minute runs, "textures picked by index" at the end:

uploaded so far waiting
without this PR (cand-7) 34,786 (16.9 GB) 16,215
with this PR (+#154) 38,120-44,678 (19.7-25.5 GB) 11,266-15,823

With this PR, the yard through the cell window is textured in our captures (ground, tables, chairs) and so is the window glass. So on this tree it does not starve the by-index pass.

Our tree has neither #610 nor TEXTURE_DROP_MIPS, and that may be the difference in yours: #610 changes which mips a slot's texture holds, and the view reuse in 44694f4 keys on the view.

(AI-assisted, Claude Code. No game data.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7164632148 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7164632148). Originally posted by [npanu420](https://github.com/npanu420) on 2026-11-25T14:01:08Z. --- On the texture question above, a counter-point from a different tree. RTX 3070 8 GB, Series S, `TEXTURE_NO_WAIT=1`, without `TEXTURE_DROP_MIPS`. The tree is ExoCalibra's `d034ac1` + #809, #95, #108 + a port of #523 + fork main `0b0074e`, with this PR and #154 merged or not. Six-minute runs, "textures picked by index" at the end: | | uploaded so far | waiting | |---|---:|---:| | without this PR (cand-7) | 34,786 (16.9 GB) | 16,215 | | with this PR (+#154) | 38,120-44,678 (19.7-25.5 GB) | 11,266-15,823 | With this PR, the yard through the cell window is textured in our captures (ground, tables, chairs) and so is the window glass. So on this tree it does not starve the by-index pass. Our tree has neither #610 nor `TEXTURE_DROP_MIPS`, and that may be the difference in yours: #610 changes which mips a slot's texture holds, and the view reuse in `44694f4` keys on the view. (AI-assisted, Claude Code. No game data.)
LeonardoS11 commented 2026-11-25 18:05:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by LeonardoS11 on 2026-11-25T17:11:07Z.


Two things from carrying this PR on an RTX 3080 Ti (12 GB, 64 GB RAM), in case they are useful.

What VICTORY_TABLED_SKIP_FRAMES costs here. Series S profile, the first room standing still, one build (f85101b with this PR and others), 300 s a run:

VICTORY_TABLED_SKIP_FRAMES ms a frame heap buffer pass buffer slots looked at a frame
unset 132 38 ms 15,044
16 166 85 ms 36,608
2 165 87 ms 39,265

With the switch the per-draw tables the title rewrites every frame are mirrored again and become marks for the buffer pass, so that pass more than doubles: about 33 ms a frame. It is the same with a pass that looks only at marked slots (#467). I am not arguing against the switch — only giving the price on a machine where the crash is rare.

How often the crash shows without it. On 64 GB: once, the same 0xc0000005 at +0x23cf683, in a few dozen launches into the world; none in the last 40 or so. #959 says that address is the title's own watchdog, firing about 30 s after the submitting thread is stuck on a fence that never comes — so a stale slot would be one cause of it among others (anything that hangs or loses the card silently). With #959's bounded wait in, the log should name the cause the next time; I will add it here if it comes back.

(Runs by me on the hardware above; read from the logs and written with Claude Code.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7169131970 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7169131970). Originally posted by [LeonardoS11](https://github.com/LeonardoS11) on 2026-11-25T17:11:07Z. --- Two things from carrying this PR on an RTX 3080 Ti (12 GB, 64 GB RAM), in case they are useful. **What `VICTORY_TABLED_SKIP_FRAMES` costs here.** Series S profile, the first room standing still, one build (f85101b with this PR and others), 300 s a run: | `VICTORY_TABLED_SKIP_FRAMES` | ms a frame | heap buffer pass | buffer slots looked at a frame | |---|---|---|---| | unset | 132 | 38 ms | 15,044 | | 16 | 166 | 85 ms | 36,608 | | 2 | 165 | 87 ms | 39,265 | With the switch the per-draw tables the title rewrites every frame are mirrored again and become marks for the buffer pass, so that pass more than doubles: about 33 ms a frame. It is the same with a pass that looks only at marked slots (#467). I am not arguing against the switch — only giving the price on a machine where the crash is rare. **How often the crash shows without it.** On 64 GB: once, the same `0xc0000005` at `+0x23cf683`, in a few dozen launches into the world; none in the last 40 or so. #959 says that address is the title's own watchdog, firing about 30 s after the submitting thread is stuck on a fence that never comes — so a stale slot would be one cause of it among others (anything that hangs or loses the card silently). With #959's bounded wait in, the log should name the cause the next time; I will add it here if it comes back. (Runs by me on the hardware above; read from the logs and written with Claude Code.)
slauko commented 2026-11-26 16:06:38 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by slauko on 2026-11-26T15:39:58Z.


The coalescing item in this PR, measured on a Linux/Wine line (RTX 3080 Ti, vkd3d-proton ec20719, uiliannn's base), in the cell at ~5,000 draws:

  • 34,282 watch::writes calls a frame — 18,887 answered from the journal, 16,395 by the kernel — 40.6–41.2 ms, and the copies 166–173 MB/17 ms for what the write watch named.
  • Of the pages the kernel's calls report: 4.6 million a frame (18 GB of address space) against 69,000 the journal names and ~203 MB actually copied. Most of what the watch reports as written was written long ago and its bits were never consumed.
  • With Batch::flush updating a copy's touching ranges in one pass instead of one pass per recorded range: 8,965 calls, 5.9–6.4 ms asking, 52–57 MB/5.9 ms copied, preparing 100–110 → 57–63 ms.
  • VICTORY_COPY_SAMPLE=1 on this line: 83–85% of the words sampled in those copies were already equal — the writes inside the named pages are sparse.

So the count is the lever, not the copy: 193 MB at 9.4–10.3 GB/s is 19–21 ms, the asking around it was 38–43.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7196582793 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7196582793). Originally posted by [slauko](https://github.com/slauko) on 2026-11-26T15:39:58Z. --- The coalescing item in this PR, measured on a Linux/Wine line (RTX 3080 Ti, vkd3d-proton `ec20719`, uiliannn's base), in the cell at ~5,000 draws: - **34,282 `watch::writes` calls a frame** — 18,887 answered from the journal, 16,395 by the kernel — 40.6–41.2 ms, and the copies 166–173 MB/17 ms for what the write watch named. - Of the pages the kernel's calls report: **4.6 million a frame** (18 GB of address space) against **69,000** the journal names and ~203 MB actually copied. Most of what the watch reports as written was written long ago and its bits were never consumed. - With `Batch::flush` updating a copy's touching ranges in one pass instead of one pass per recorded range: **8,965 calls, 5.9–6.4 ms asking, 52–57 MB/5.9 ms copied**, preparing 100–110 → 57–63 ms. - `VICTORY_COPY_SAMPLE=1` on this line: **83–85% of the words sampled in those copies were already equal** — the writes inside the named pages are sparse. So the count is the lever, not the copy: 193 MB at 9.4–10.3 GB/s is 19–21 ms, the asking around it was 38–43.
slauko commented 2026-11-26 17:05:10 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by slauko on 2026-11-26T17:05:10Z.


A correction to my numbers above, for the coalescing item: the merged run keeps the title on its prologue card.

  • 8,965 calls, 5.9-6.4 ms asking, 52-57 MB and preparing 57-63 ms were a prologue frame; with the change in, no run reached the cell (m66-m79: 3,000-3,100 draws on the prologue's card).
  • The pre-merge binary reaches the cell (m76: 4,976 draws, 209.8-214.8 ms); sorted, in recording order and capped at 4 MiB all do not.
  • With the merge out and the rest kept: cell 205.1 ms median (m80, 4,968-5,000 draws), asking 34.3-34.6 ms at ~34,000 calls.

So: coalescing the ~34,000 refreshes a frame is the right target (34 ms of asking), but merging the ranges changes something the intro's transition needs on this stack. A coalescing that keeps each range's own update (one asking ahead, many updates) would be the shape to try, not one update per merged span.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7198476464 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7198476464). Originally posted by [slauko](https://github.com/slauko) on 2026-11-26T17:05:10Z. --- A correction to my numbers above, for the coalescing item: **the merged run keeps the title on its prologue card.** - 8,965 calls, 5.9-6.4 ms asking, 52-57 MB and preparing 57-63 ms were a prologue frame; with the change in, no run reached the cell (`m66`-`m79`: 3,000-3,100 draws on the prologue's card). - The pre-merge binary reaches the cell (`m76`: 4,976 draws, 209.8-214.8 ms); sorted, in recording order and capped at 4 MiB all do not. - With the merge out and the rest kept: cell **205.1 ms** median (`m80`, 4,968-5,000 draws), asking 34.3-34.6 ms at ~34,000 calls. So: coalescing the ~34,000 refreshes a frame is the right target (34 ms of asking), but merging the ranges changes something the intro's transition needs on this stack. A coalescing that keeps each range's own `update` (one asking ahead, many updates) would be the shape to try, not one update per merged span.
slauko commented 2026-11-26 18:03:30 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by slauko on 2026-11-26T18:03:30Z.


Closing the coalescing item with the measurement from my line (Linux/Wine, RTX 3080 Ti, vkd3d-proton ec20719):

  • one asking per copy per submission (one GetWriteWatch for everything the submission refreshes of it, each range's update served from that answer, order unchanged): cell 193.7/200.3 ms against 205.1 (m80), the copies 20-22 ms for 156-167 MB against 55-60 for 170-180 — but one of the two runs is visibly broken (floating polygons, garbage geometry, black clipping on the character).
  • reverted (0360aad5); with the merged-range variant (34 ms of asking saved, title stays on its prologue card) four shapes of this lever are now measured and rejected. The asking stays per range, and the ~34 ms it costs are not reachable by moving or widening it.
<!-- greyfinch-sync:fxceless/victory-fork:comment:7200004124 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/827#issuecomment-7200004124). Originally posted by [slauko](https://github.com/slauko) on 2026-11-26T18:03:30Z. --- Closing the coalescing item with the measurement from my line (Linux/Wine, RTX 3080 Ti, vkd3d-proton `ec20719`): - one asking per copy **per submission** (one `GetWriteWatch` for everything the submission refreshes of it, each range's update served from that answer, order unchanged): cell **193.7/200.3 ms** against **205.1** (`m80`), the copies **20-22 ms for 156-167 MB** against 55-60 for 170-180 — but one of the two runs is **visibly broken** (floating polygons, garbage geometry, black clipping on the character). - reverted (`0360aad5`); with the merged-range variant (34 ms of asking saved, title stays on its prologue card) four shapes of this lever are now measured and rejected. The asking stays per range, and the ~34 ms it costs are not reachable by moving or widening it.
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/827:upstream-pr/827'
git switch 'upstream-pr/827'

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/827'
git switch 'upstream-pr/827'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/827'
git switch 'upstream-pr/827'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/827'
git switch 'main'
git merge --squash 'upstream-pr/827'
git switch 'main'
git merge --ff-only 'upstream-pr/827'
git switch 'main'
git merge 'upstream-pr/827'
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
fxceless/victory-fork!826
No description provided.