Ray-tracing builder runs on an RTX 5070 (32-lane) - then the title crashes on f16 box bounds #16
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#16
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@asdaasdsaddf on GitHub · 2026-11-24 19:52 UTC · original
Ray-tracing builder runs on an RTX 5070 (32-lane) — then the title crashes on f16 box bounds
Tester report, AI-assisted (Claude Code). Logs, counts and hashes only; no game data.
Machine: Windows 11, NVIDIA GeForce RTX 5070 12 GB (driver 616.64), AMD Ryzen 5 5600, 40 GB RAM. Series X profile. Your
mainat7b0f736plus the two small changes below.1. Why the builder stayed off on NVIDIA
With
VICTORY_BVH_BUILDER=1the log saidthe ray-tracing structure builder stays off ... missing=3 of=53.Translating
XboxBvhBuilder.dlloffline as a 32-lane host (VICTORY_HOST_WAVE=32 victory translate --list XboxBvhBuilder.dll) gives 49 of 52. The three that fail are:@0x99160#dc78c5de69c7c155@0x9a830#322ed4ad832bdea6@0x9be80#d441b097704ab616All three stop on
a first-lane read where not every lane runs(at 0x258 / 0x23c / 0x23c). They are 512-thread prefix-sum passes:v_readfirstlane v8at 0x1d4.v8 = s17 + lds[s16]is a sum of scalars, the same in every lane, and the loop exits per console wave (v7 = tid >> 6).2. Change A:
VICTORY_FIRSTLANE_OWN=1(opt-in)In
lower.rs, when the two host halves would need to exchange but not every lane runs, this takes the host wave's own first lane instead of refusing. That is exact when the value is uniform over the console wave, as in these scans.Results with it on:
VICTORY_HOST_WAVE=32): 52/52 emit, validate with dxil.dll, and create host pipelines on the RTX 5070.the ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53.3. Change B:
v_cvt_f32_f64loweringThis one is unrelated to the builder. Game compute shaders 5dc3b25986622949, 6f225b641c5b0708 and 926c46bab3b86bd6 were refused on
v_cvt_f32_f64. I lowered it with 64-bit integer math on the double's bits:These three shaders then stop later at the same addresses with
a whole-wave section step the simulation does not follow, sowave.rswould need the op too.4. The crash once the builder runs (looks like your run 98)
Without
VICTORY_BVH_QUARANTINE:builder runs, still in the prologue lead-out prestream (cine@leadout@int_prolo@int@leadout), frame 1094.VCRUNTIME140.dll+0x1c177, reading 0xffffffffffffffff.image+0x4f1414f,+0x26778e0,+0x26777d5,+0x256fb83and+0x221c29c.rax 0xfc00fc00fc00, which is f16 −inf: the "empty box" bound pattern. So builder stores are landing on the title's own objects, as in your run 98.With
VICTORY_BVH_QUARANTINE=1: the title also crashes about 5 s afterbuilder runs(int_prolo_int_prolo_intprestream, frame 1233). That fits your note that quarantine leaves the title without sizes and counters.Other things in the log around the builder:
title memory by address: shaders touched pages that had no copy(13 times).no number left for another copy; its pages read zeros COPIES=....I can't tell yet whether the bad stores come from change A's approximation, from the lost page accesses, or from another stage. If it would help, I can rerun with any diagnostic switch you suggest and send the counts.
Also tested:
--console series-sgave no image change;VICTORY_LATE_WAIT=1with the card-buffer switches made little FPS difference here (about 1.8–2.3 fps in the prologue).@bunbeans2-arch on GitHub · 2026-11-24 21:32 UTC · original
Same two crashes on a 64-lane GPU (RX 9070 XT) without change A, so change A is not the cause
On RDNA 4 the three prefix-sum builder passes keep their 64-lane form, so the builder can come up on an unmodified tree. That gives a control for your question "whether the bad stores come from change A's approximation".
Machine: RX 9070 XT, driver 32.0.32015.7029, 32 GB, Windows 11 Pro build 22631, Series X profile, diag build.
7b0f736plus a local input-file patch only (no GPU or translator changes), so no change A and no change B.host wave lanes min=32 max=64.VICTORY_BVH_BUILDER=1: the log saysthe ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53. Nothing was skipped or changed to get there.VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=10xc0000005writing address 0, in title code; the exception line is logged before the builder line, and the last timestamp before it is 21:25:35.063VICTORY_BVH_BUILDER=10xc0000005reading 0xffffffffffffffff, in title code; the last timestamp before it is 21:28:04.944, about 12.7 s after the builder startedshaders touched pages that had no copyorno number left for another copy; its pages read zeros(0 lines each; the same tree'smemory.rs183 and 219 log them as warnings).So with every builder pass in its native 64-lane form and no lost page accesses logged, the title still fails the same way. My guess is that neither change A's first-lane approximation nor the missing page copies is needed for the bad stores; another stage of the builder (or its inputs) is more likely. I can run a diagnostic switch on this card if you name one.
AI-assisted (Claude Code): measured on this machine with my own copy of the game. Counts and log lines only; no game data.
@CDR-0000 on GitHub · 2026-11-24 21:34 UTC · original
RTX 3080 Ti: reproduced with #36 instead of change A, then narrowed down with a write-back trace — the builder's stores land where it was pointed; the title crashes on f32 empty-box bounds the builder never fills in. Relay timing ruled out.
Setup: RTX 3080 Ti 12 GB (32-lane), driver 32.0.16.1742; Ryzen 7 7800X3D; 32 GB; Windows 11 Pro 26300; release build. Fork
main4e17478+ #36 + upstream #454 (VICTORY_NO_WATCHDOG=1, hooks applied=2) + a local diagnostic (below).VICTORY_BVH_BUILDER=1, no quarantine, cold cache.1. #36 lets the builder run on NVIDIA —
XboxBvhBuilder.dll52/52 emit/validate/create pipelines at 32 lanes (49/52 without). In game:the ray-tracing structure builder runs ... pipelines=53. So change A's approximation is not the cause: the crash below happens with #36's exact form too.2. Crash — 3 runs, every time 7–14 s after the builder starts, prologue, black screen:
image+0x8f92a(read0xffffffffffffffff), stack+0x79977/+0x4eea9f5 → +0x2677819 → +0x256fb83 → +0x221c29c → +0x2215eca; others at+0x55ceb22,+0x5592694,+0x4e335b4with+0x26778e0 → +0x26777d5 → +0x256fb83(same frames as yours).rax 0xff8000007f800000(run 2) andrax 0x7f8000007f800000(run 3): f32+inf/-infand+inf/+inf— the empty-box bounds of 128-byte box32 nodes. The title's CPU code is reading builder results whose bounds were never shrunk from their initial empty value.3. Write-back trace (
VICTORY_BVH_TRACE=1, local diagnostic: notes the copies each builder dispatch is pointed at via root views / address constants, and every merge of GPU bytes into title memory from the builder's first dispatch on, counting f16/f32 empty bounds):VICTORY_RELAY=2)shaders touched pages that had no copySo: no stray store reaches the objects the crashing code uses, the builder finds a copy for every page it touches, relay timing makes no difference, and
global_atomic_fmin/fmaxlower to a CAS loop over real FMin/FMax (not integer compares). What's left, as far as I can see: the builder computes from stale inputs — e.g.memory.rs's shortcut that a copy another list numbers meanwhile is only brought up to date by that list's submission, which may run later — and so never shrinks the empty boxes. Happy to run a targeted check if you point me at the stage whose inputs matter most.The trace is ~230 lines (
bvhtrace.rs+ hooks inmemory.rs,draw.rs,shadow.rs, off unless set); I can open it as a PR if it's useful.Written with Claude Code (Claude Opus 5.5); the runs are mine.
@dkdknight on GitHub · 2026-11-24 21:51 UTC · original
RTX 5080 (Blackwell, 32-lane): the same crash, 7 s after the builder starts, loading a gameplay checkpoint (not the prologue).
Setup: NVIDIA GeForce RTX 5080 16 GB, driver 621.14, i9-13900KF, Windows 11 26200, release build, Series X profile. Tree:
4e17478+ #71 + #81 + #77 + #38 + #36 + #9. Switches:VICTORY_BVH_BUILDER=1(no quarantine),VICTORY_RELAY=2 VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024.What happened
VICTORY_HOST_MAX_WAVE=32 victory translate XboxBvhBuilder.dll), all 52 builder programs translate and emit.the ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53. The title stops 7 s later, after 21 first-chance access violations:raximage+0x27c195d0xffffffffffffffff(and once0xbe330008)0xbeadc00000000000image+0x8f92a0xffffffffffffffff0xfc00fc00fc007c00image+0x4f38ba50xffffffffffffffffimage+0x4e335b40x380xfc00fc00fc007c00image+0x52eca7e0x7VCRUNTIME140.dll+0x1cca70x7c007c007c00rax 0xff8000007f800000also shows up, as in CoDrift's runs.shaders touched pages that had no copyandno number left for another copy: 0.One detail that may help: the faulting address
0x7c007c007c00is three f16+infwords, so the title loaded a pointer from memory that still holds the empty-box fill. That fits CoDrift's reading: the nodes or records the title walks on the CPU were never written by the builder, rather than overwritten by a stray store.Unrelated, same build, first launch: the title's own GPU stall check stopped it at the menu (
image+0x23cf683, write0x0). It came after ~30 s with no present while about a thousand host pipelines were being made for the new build. The second launch, with the library warm, got through.AI use: Claude Code, Claude Opus 5.5 merged and built the tree and ran both launches on the machine above (the person at the machine loaded the save). It read the logs and wrote this comment.
@Revens2 on GitHub · 2026-11-24 22:34 UTC · original
RTX 5070 (32-lane): reproduced with #36; three f16-side switches ruled out. No fix yet.
Setup: RTX 5070 12 GB, driver 32.0.16.2124, Windows 11 26200, release build, Series X profile.
main4e17478, and the same plus #36 (merged locally, no other change).VICTORY_BVH_BUILDER=1, no quarantine, default switches otherwise. Driven through a 2-slot runner; no game data below, counts and log lines only.mainnon verifie: whether the builder stays off past loading, since this run never loaded.main+ #36the ray-tracing structure builder runs ... pipelines=53, then0xc0000005(read0xffffffffffffffff), process exit-1073741819, 17 s after the builder line (first-chance exceptions start earlier).write_half; the tree keeps it today)image+0x4f38ba5,+0x8f92a).VICTORY_F16_NEAREST=1+VICTORY_WAVE_OWN_BITS=0So on this card the crash needs the builder to run (run 1 vs 2) and does not depend on f16 rounding (nearest vs the host's conversion), on whether a 16-bit write keeps or clears the register's other half, or on the own-bits wave lowering. That agrees with the 64-lane control and with CoDrift's trace: the f16 conversions are not what leaves the empty-box bounds in place.
Instruction census of the 52 builder programs (translator,
VICTORY_HOST_WAVE=32, 52/52 emit with #36): the f16 work is small (11 programs:v_cvt_f16_f32in 4,v_pk_min/max_f16andv_min3/max3_f16in 2,v_cvt_f32_f16in 9);global_atomic_fmin/fmaxis in 7. The remaining cross-lane users (v_permlanex1613 programs,ds_swizzle8,v_readlane19,v_mbcnt20) are untested against the console on a real card, but I have no oracle for them either.I am not opening a PR: I found no defect I can show with a test. What would narrow it: a per-stage switch that makes one builder pipeline a no-op (so the first stage whose absence changes the crash can be named), or a dump of the stage that writes the nodes the title walks, which I cannot publish from here.
AI-assisted (Claude Code, Claude Sonnet 5.5): the runs are mine, on my own copy of the title.
@joroyt on GitHub · 2026-11-25 00:06 UTC · original
RTX 5070: the "stale inputs" guess measured. Three real defects in how host copies follow title memory, two fixed, and the crash is still there with all of them fixed.
Setup: RTX 5070 12 GB (32-lane waves, driver 32.0.16.2124), i9-14900KF, Windows 11, diag build, Series X profile,
2119b0e+ #156,VICTORY_BVH_BUILDER=1, no quarantine. The crash reproduces as above: 5-15 s afterthe ray-tracing structure builder runs, first sites+0x8f92a,+0x4f38ba5,+0x27c195d,+0x5592694, reading0xffffffffffffffff. About 20 short runs in all.The check. A local diagnostic compares every range a submission declares as written with title memory, right after the range's refresh and before the lists run. By the design they must be equal then (the merge only puts back bytes that differ from the snapshot, so a copy that is stale at that moment loses every store that happens to rewrite what the copy already held). A piece counts as stale for good when it differs at two checks in a row while the title's bytes did not change in between.
1. Writes through another view of the same pages are not seen. Without #115, once the builder runs, 13-29 pieces of 64 KiB a second in windows are stale for good, plus 948 pieces (44 MB) of title buffers in the second of the crash. With #115: windows clean. So #115 is not only about the boot video.
2. #115 notes the other views clean. With #115, 747-870 pieces (34-40 MB) of title buffers were still stale in every run, the copy all zeros and title memory all
0xff. Those blocks are mapped views, read-only, noted copied. Cause:protectmakes the other views of a page read-only throughprotect_here, which also notes them clean, though their copies never took the page. It shows here because one physical page is shown at five or six title addresses and each address has a host copy of its own (three title buffers and three windows for the pages I looked at). Fix with a failing test: Spexivus/victory-fork#1. With it: 0 stale pieces in 2 of 2 runs.3. Copies another list numbers are skipped.
memory::readyrefreshes and declares copies once per list. In the builder's first two seconds, 16 dispatches found 210 copies their list had neither brought up to date nor declared written (13 of those lists store). Fixed in #370.4. Tried, no effect: one host copy for all addresses of a page, for access by address. In the builder's first half second, over 512 of about 45,000 pages got a copy by address while another address of the same page already had one. Pointing them at the first copy (local switch, by-address directory only; root views and descriptors keep their own copies) changed nothing: 2 of 2 runs crash the same way.
Result. With 1-3 fixed, every declared range I can check equals title memory before the lists run, and the title still crashes at the same sites after 6-7 s (2 of 2 runs; 2 of 2 more with 4 as well). So stale copies at submission are ruled out as the cause, as far as this check reaches. It does not see: ranges still pending from an earlier declaration, copies in the card's memory, pages that cannot be read at that moment (up to 60 % of the window pieces declared in a second), and what happens between two stages inside one submission.
That last one is what I would look at next: several host copies of one physical page are only reconciled through title memory, after a submission. A stage that stores through one address and a later stage of the same submission that loads through another address of the same page (a root view or a descriptor, not by address) cannot see each other's bytes. I have not shown that the builder does this.
Also seen, in case it saves someone a run: with the builder on, 12 GB a frame is snapshotted and compared on the CPU (every numbered window is declared written by every storing list), 4.4 s a frame here with 0.2 s of it on the GPU, and the 1,023 numbered copies run out within 6 s with quarantine on.
AI use: Claude (Anthropic) in OpenCode, on my machine with my own copy of the title. Counts, addresses and log lines only; no game data.
@Etr0p on GitHub · 2026-11-25 00:31 UTC · original
Results from an RTX 5070 Ti Laptop (32-lane waves, Windows 11, NVIDIA driver 621.24), Series X profile,
VICTORY_TEXTURE_GUARD=0,VICTORY_BVH_BUILDER=1. Counts and classes only.The builder translates in full on 32 lanes. With an LDS read at an address every lane holds alike counted as wave-uniform (the idea of #36, also inside #156), the three 512-thread prefix-sum passes no longer ask for a half-wave exchange where not every lane runs. Offline with
VICTORY_HOST_WAVE=32: 52 of 52 builder programs emit, pass dxil.dll validation and create host pipelines on this card. In game the log says the builder runs with all 53 pipelines. None of the 52 goes through an approximate wave64 form (VICTORY_WAVE_WHYshows no retry).The title still crashes once the builder runs: in the world in the first run, then during the loading screen in later runs (about 70 to 106 s after start), always with access violations on several threads and no device loss.
What I checked, with a local diagnostic that logs every copy-back into title memory, the pipelines of each submission, and the addresses each builder dispatch is given (root views and address pairs in its root constants):
So the builder writes where it is told to, and the content of its main buffer looks sane, yet the title ends up reading node data (f16/f32 bounds, -1) where it expects pointers, in objects the GPU did not write. My guess is that the title derives something on the CPU from a builder result, or expects a part of a structure that the builder writes differently here.
Ruled out on this setup: #205 (copies numbered by another list) alone does not change it. #349 does not apply, since none of the 52 builder programs uses
v_div_fixup_f32. #354 does not apply either: the four wave64 builder programs already exchange halves, read only the wave number withv_readfirstlane, and have nov_fmacaccumulators.A natural next check would be a run with
VICTORY_BVH_QUARANTINE=1on the same build, to confirm that it is the copied-back results that poison the title.AI-assisted (Claude Code); measured on my own machine.
@Yorivel on GitHub · 2026-11-25 01:47 UTC · original
RTX 4090 (32-lane, driver 621.40), i9-14900K, diag build: reproduced, and one stale-input source ruled out.
Tree:
a803c87+ #156 + #461 + #190 + the DirectStorage page-write fix from #62 (VICTORY_DSTORAGE_NOTIFY=1, branchfix/dstorage-notify-on-a803c87on Yorivel/victory-fork). Switches:VICTORY_BVH_BUILDER=1 VICTORY_RELAY=2 VICTORY_SHADER_OPT=0 VICTORY_SHADER_LOOP_LIMIT=256.the ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53.+0x4f38ba5(read0xffffffffff000017),+0x164945e,+0x27c195d,+0x8f92a,+0x55ceb22,+0x52ec9f5, reading0xffffffffffffffffon many threads. These are the same sites as joroyt's and Revens2's runs.VICTORY_BVH_QUARANTINE=1it crashed too (+0x4e3390d), as expected without the sizes and counters coming back.The DirectStorage fix brings the host copies of PAGE_DESTINATION reads up to date; without it, copies stayed stale for a whole run and the first room was missing in about 3 of 4 runs. It does not change this crash. So that source of stale builder inputs is ruled out, on top of the three defects joroyt fixed.
@Yorivel on GitHub · 2026-11-25 02:10 UTC · original
RTX 4090, follow-up: some of the crash registers point into physical memory the title maps at three addresses at once. It's a lead, not a cause yet.
I added a local diagnostic (
VICTORY_VIEW_LOG=<file>inxmem.rs) that writes every physical view mapped (base len section first-page) and unmapped, one line each. Then I replayed it up to the crash and looked up each register of the first reports. Same tree as above,VICTORY_BVH_BUILDER=1.+0x27c195dand+0x4e51965:rbx 0x6cd220000, the same physical page as0xccd220000and0xf1e580000+0x4e51965:rbx 0x653aaa000, the same page as0xc53aaa000and0xf7aa4a000+0x4f38bb4(write0x80000010):rcx 0x65517c090, the same page as0xc5517c090and0xef75ec0900x6…address, a twin exactly0x6_0000_0000higher, and a third view at0xf….0xd3…,0xdf…,0xe0…) are in no physical view, so this is not every crash object.Why it may matter: the traces above match GPU writes against the crashing objects by address. If a builder stage writes or reads through the
0xc…/0xf…view of a page that the CPU uses at0x6…, an address match calls the object untouched, though it is the same memory. That is joroyt's open point (several host copies of one physical page, reconciled only through title memory). These runs show the crash objects sit in exactly such pages.Not shown yet: that a builder dispatch is pointed at one of these twin addresses. Next I'll log each builder dispatch's root views and address constants and check them against the views at the crash.
@Yorivel on GitHub · 2026-11-25 02:13 UTC · original
RTX 4090, follow-up 2: a builder dispatch and a crashing CPU object on the same physical page, through the two twin addresses.
Same tree, plus a second local diagnostic:
VICTORY_BVH_ADDR_LOG=1indraw.rslogs each builder dispatch that runs, with its roots, in the format oflist_dropped_roots. 12,425 builder dispatches were logged before the crash, and their root views and address pairs name 2,973 physical pages, resolved through the view log at the crash.The match:
image+0x2bd385b, twice:read 0x28, thenread 0x7c0001fc0028, withrbx 0x531eb9000. The object holds0x7c0001fc0000at+0x28, f16+infbound data where a pointer is expected.0x531eb0000and at0xb31eb0000(+0x6_0000_0000).view 0xb31eb7100 in no bufferin 7 dispatches of three builder programs:caa78b8ca62bc3d6(5),5e68767498c57eb6(1),4ddd6f9702fab2a7(1). An example of their roots:0=constants [1, ffffd3c0, 2380, 0, 47800000, 48000000, 47000000, 1, 3f800000, 0, 0, 462, …] 1=view 0xb31eb7100 in no buffer 2=view 0xb31eb7100 in no buffer 3=view 0x1b7ace79280 in no buffer 4=view 0xd6a6df840 in no buffer 5=view 0x100c805f04 in buffer 0x100b620000+0x4000000 …0x1f00bytes past those two root views, on the same page, reached through the other address. An address-by-address trace of writes into title memory would not link the two.What I can't tell yet is which of these happened:
0x1f00bytes from0xb31eb7100(a size from a stale or wrong input, since a root view has no size here);0x531eb9000through the host copy kept for0xb31eb…being merged back as a whole piece, over what the CPU wrote through0x531eb…meanwhile;Some other crash sites of the same run (
+0x8f92a,+0x27c195d,+0x4f38ba5) have no register in a page the builder names, so this is one thread of it, not all of it.The two diagnostics are small and opt-in, and I can push them as a branch if they're useful.
@Yorivel on GitHub · 2026-11-25 02:16 UTC · original
RTX 4090, follow-up 3 (negative): re-copying pages shown at two addresses doesn't change the crash.
I tested reading (b) from my last note in its "stale reads" form. The local switch
VICTORY_ALIAS_REFRESH=1makesShadow::copy_stalecopy every page that theinplaceview map shows at more than one address on every refresh, written or not.inplace.rsgets a per-(section, 64 KiB page) view count for this. So a write through the twin address can't leave a copy stale on that path.Result: the builder runs (
pipelines=53, 02:16:20.96), and the title crashes at the same first site+0x4f38ba5(read0xffffffffffffffff) at 02:16:28.1, about 7 s later, as without the switch.So stale reads through the twin address on the normal refresh path are ruled out. This does not cover:
card_dirty/card_merge_relay);0xb31eb…landing on bytes the CPU wrote through0x531eb….The switch and the logs are on
diag/bvh-aliasin Yorivel/victory-fork.@Revens2 on GitHub · 2026-11-25 02:31 UTC · original
RTX 5070 (32-lane): bisection with a per-pipeline switch — the crash needs one of two builder pipelines (creation index 49 or 50); each alone is enough. No fix yet.
Setup: RTX 5070 12 GB, driver 32.0.16.2124, Windows 11 26200, diag build.
main4e17478+ #36 (merged locally) + the switch from #579 (VICTORY_BVH_SKIP=<indices/ranges>; builder pipelines are numbered in creation order, 0-52 here, and logged asray-tracing structure builder pipeline index=N shaders=[hash]).VICTORY_BVH_BUILDER=1, no quarantine. A skipped index drops that pipeline's dispatches; all others run. Counts and log lines only, no game data.Control (no skip):
the ray-tracing structure builder runs ... pipelines=53, then 13unhandled exception 0xc0000005lines (reads of0xffffffffffffffff,image+0x8f92a,+0x4f38ba5,+0x27c195d, same sites as above), process exit-1073741819, 0 device removals.-1073741819)So with pipelines 0-48 and 51-52 skipped or not, the title survives as long as 49 and 50 are both dropped, and it crashes when either one runs. Their title shader hashes:
caa78b8ca62bc3d6(container 11,840 bytes) and28918b7150a7aad5(11,052 bytes); stage 48 (38,248 bytes) alone does not crash.What this does and does not show:
non verifie: what the title shows or does without them (the runs stayed on the loading screen).Note on the runner: with two sessions running, a single ENTER at 48 s was not delivered in 3 of my runs (stuck on the profile selector); those runs are discarded above and repeated with ENTER at 40/55/70/85/100/115 s.
AI-assisted (Claude Code, Claude Sonnet 5.5): the runs are mine, on my own copy of the title.
@Yorivel on GitHub · 2026-11-25 02:35 UTC · original
RTX 4090, follow-up 4: the builder's memory above the 40-bit directory, found and moved low. The crash stays.
memory.rs's directory for raw-address access covers the first 128 GiB (MEMORY_PAGES = 1 << 21). A pointer past it is clamped to the last entry, which is never filled, so the access reads 0 or its store is dropped. Nothing logs it, sincemap()returns early for that page. In my runs 83% of builder dispatches (10,297 of 12,425) had root views or address constants above 128 GiB, at0x16…–0x23…, private host memory.The source was
list.rsallocate_upload: per its own comment, the builder's instance descriptions go there, and they were backed byvec![0u8; len]on the host heap. On the way I also ruled out the title's CRTmalloc, itsVirtualAllocwithout an address,XMemAllocDefaultand device heaps; none of them held builder memory.A local switch,
VICTORY_LOW_HEAP=1ondiag/bvh-alias(Yorivel/victory-fork), places these blocks below 128 GiB withVirtualAlloc2address requirements (68–120 GiB). It does the same for heaps from our allocator, the title'smalloc(anRtlCreateHeapheap in a 1 GiB region) and address-lessVirtualAlloc. With it:+0x4f38ba5(read0xffffffffffffffff), about 11 s after the builder starts.So lost raw-address accesses are not the cause either. The
allocate_uploadplacement is still a real defect for anything that walks the instance descriptions by pointer, so it may be worth keeping. Ruled out so far on this 4090: stale reads through twin addresses (follow-up 3), and memory above the directory (this note).@Yorivel on GitHub · 2026-11-25 02:43 UTC · original
RTX 4090, follow-up 5: builder node data written back over a crashing object, through the twin address.
A new local diagnostic,
VICTORY_WRITEBACK_LOG=<file>inhost.rs, logs every write of ours into title memory (write_mapped/copy_mappedto the title): address, length, which merge made it (copy_back,relay_merge,card_merge,card_merge_relay) and its first 64 bytes. I matched those writes against the crash registers by physical page, using the view log.Run 1 (contents not logged yet): four crash sites had their object written back once, shortly before the crash, each time through the other address of the same page:
+0x4f38bb4,rcx 0x6d30f9610, written through0xcd30f9610+0x2bd385b,rcx 0x69043beb0, written through0xc9043beb0+0x4f4884f,rbx 0x12dac2600, written through0x72dac2600+0x4684e7,rcx 0x699270000, written through0xc99270004Run 2 (with contents): two crashes at
+0x2bd385b(read 0x28), withrbx 0x68ef0fc00andrbx 0x6cac69000. Each object was written once, byrelay_merge, through0xc8ef0fc00and0xccac69000. The two writes:These are f32
+inf/-infempty-box bounds and-1words: builder output. One merge put almost a whole 64 KiB page of it at0xc8ef00000…. The CPU object the crashing code reads sits at+0xfc00of the same physical page, through0x68ef0….Together with follow-up 3 (re-copying aliased pages changes nothing), this says the GPU-side builder really writes node data over memory the title uses for live CPU objects, and VIctory's merge faithfully copies it back. That points at the builder writing more, or further, than the title sized its memory for. One likely cause is a count or size the GPU stages read differently from what the CPU side used for the prebuild size.
Merges by kind in run 2:
relay_merge5,584 (264 MB),card_merge_relay1,507,copy2,304. Next I'll pair these writes with the builder dispatch roots (VICTORY_BVH_ADDR_LOG) to name the stage and see how far past its root view it writes. Diagnostics ondiag/bvh-alias(Yorivel/victory-fork).@Yorivel on GitHub · 2026-11-25 02:44 UTC · original
RTX 4090, follow-up 6: the overwritten objects sit at fixed distances past one builder buffer (roots 1 and 2).
Run with
VICTORY_BVH_ADDR_LOGandVICTORY_WRITEBACK_LOGtogether, matched by physical page:+0x55ceb22r13/r15 0x69b24e100relay_mergethrough0xc9b24e100+0x20000past roots 1/20xc9b22e100+0x55ceb22r13/r15 0x66228fc00relay_mergethrough0xc6228fc00+0x6b00past roots 1/20xc62289100In every case roots 1 and 2 hold the same address,
view … in no buffer, at a page start+0x100. The programs given that root, in this run and in the earlier ones:caa78b8ca62bc3d6(3,865 dispatches)28918b7150a7aad5(2,134)4ddd6f9702fab2a7(649)5e68767498c57eb6(649)Their root 0 constants look like a build description. Examples:
Roots 3+ are the per-build inputs (
0x11…, whichVICTORY_LOW_HEAPplaced low;allocate_upload) and the shared0x100b620000+0x4000000buffer.If word 2 is the size of the region at roots 1/2 (0x400–0x3980 here), writes reaching
+0x6b00and+0x20000are far past it, into memory the title has given to CPU objects. I don't know this builder's layout, so treat that as a reading, not a finding. If someone knows what roots 1/2 and word 2 are, the next check is whether these four programs' stores stay inside that size.@Yorivel on GitHub · 2026-11-25 02:48 UTC · original
RTX 4090, follow-up 7: one crashing "object" is exactly a node slot the builder wrote as told. The output's content is wrong, not its place.
I read the native code of the four programs (
victory shader-info --disasm XboxBvhBuilder.dll; containers found by BLAKE3 at0x28770caa78b8ca62bc3d6,0x25c4028918b7150a7aad5,0x2b5b05e68767498c57eb6,0x34b204ddd6f9702fab2a7).caa78b8cwrites one 64-byte node per thread atroot2 + word0 + (group << 12) + tid * 64(s28 = c[0] + (s4 << 12),v20 = v0 << 6 + s28): f16 box fields as 16-bit stores, child boxes min/max'd from+inf/-infstarts. There is no bounds check (num_records = -1), every thread writes, and it does 64-lane prefix sums (dpp8,permlanex16,v_readlane 32,s_bcnt1 exec).4ddd6f97copiesc[0]16-byte records root 1 → root 2 (the same address), clearing bit 24. Thread 0 also stores-1atroot2 + d14 + ((((d12 << 3) & ~63) - d13) >> 4 & ~3), withd12..d14read from the buffer at+48.I then set the computed
caa78b8cwindows against the written-back crash objects (same run as follow-up 6):+0x55ceb22,r13/r15 0x66228fc00: inside the window of the dispatch withroot2 0xc62289100,word0 0x4480, 57 groups, exactly node slot 154 (64-byte aligned).+0x55ceb22,r13/r15 0x69b24e100: outside everycaa78b8cwindow by0x1c80, probably a28918b71window (formula not traced yet).So at least this one is not a stray store. The title's CPU code reads the builder's output through the CPU view (
0x6…) of the same pages, as a CPU-side walk of the structure would. In the slot it expects a real node, with a pointer, it finds an empty-box node (+inf/-inf,-1).I now read #16 as wrong builder results, not memory corruption: empty boxes where real nodes belong, which usually means the GPU stages saw empty or zero inputs (instances, primitives, counts). That would also explain the same crash on a 64-lane AMD card. Next step: check what the GPU-side copies of root 1 and root 3 (the per-build inputs) hold at these dispatches, against title memory.
@Yorivel on GitHub · 2026-11-25 02:51 UTC · original
RTX 4090, follow-up 8: a correction to 7, and every lane of
caa78b8cwrites a node.Correction: the "empty output" reading in 7 doesn't hold. Of the write-backs landing in
caa78b8cnode windows, the first 64 bytes are a real node in 435 cases, an empty box in 167, zeros in 9. Empty boxes in unused child slots are normal for a 4-wide node, so the builder is not producing only empty trees.What holds:
caa78b8csaves the launch exec mask (s_mov_b64 s[22:23], execat0x2b4, after the 64-lane setup, before thev_cmpx_ne_u32 exec, 0, v10count test) and restores it at0x910, before the node stores at0xa14…0xb14. So every lane of every group stores its 64-byte node atroot2 + c[0] + (group << 12) + tid * 64, unbounded. Each dispatch writes exactlygroups × 4 KiB, on the console as well.With that, in the same run (649 builds by distinct root 2):
0x1000+c[0]) on builds0x400–0x800apart, e.g.0xb205e7100(0x1240) →0xb205e7900(+0x800) →0xb205e7d00(+0x400).0x66228fc00is node slot 154 of a 57-group window (root2 0xc62289100,c[0] 0x4480),0x6b00into it.Not settled yet: whether these overlaps are sequential reuse of one scratch area, which is harmless, or concurrent, which is a real overrun. That depends on the order of the builds and when the title consumes each result. If they are overruns, the group count (computed by the library's CPU side, possibly from sizes read back from earlier stages) is the number to doubt.
@Yorivel on GitHub · 2026-11-25 02:55 UTC · original
RTX 4090, follow-up 9 (summary of tonight's checks): most crash objects are never written by the GPU side.
VICTORY_RELAY, the builder on, the same logs) the title crashes the same way (+0x4f38ba5). Only one crash register in that run lies on bytes any write-back of ours covered (copy_back, outside everycaa78b8cwindow).write_mapped/copy_mappedtouched.VICTORY_INPLACEis off, so the GPU doesn't write title memory directly either.+0x4f38ba5, is a generic refcounted release:mov rcx,[rcx+0x10]; mov rsi,[rcx+0x18]; lock dec [rcx+0x10](function0x4f38b80, an 8-way switch). The pointer at+0x10of an ordinary CPU object was-1-ish.So in this setup the bad values reach most crashing objects through the title's CPU code, which takes something the builder produced (a size, a count, an offset,
-1) and passes it on into its own objects. The few direct overwrites (node slots ofcaa78b8cwindows) look like consequences of the same wrong numbers, for example a group count of 57 for one build.Ruled out here: stale twin-address reads (3), memory above the 40-bit directory (4, fixed by
VICTORY_LOW_HEAP), merge order between two copies (8), relay timing (this one), direct in-place writes. The next useful step is on the CPU side: which builder result (postbuild sizes, counts, header words read back) the title consumes before the first bad pointer appears. Diagnostics and scripts are ondiag/bvh-alias(Yorivel/victory-fork); happy to run anything on the 4090.@Yorivel on GitHub · 2026-11-25 03:00 UTC · original
RTX 4090, follow-up 10: the node windows belong to rehydrations of disk-loaded structures, and 48 of 323 run into the next structure.
A new local diagnostic,
VICTORY_BVH_CALLS=1(crates/victory-hle/src/bvhcalls.rs), points the game exe's import slots forXboxBvhBuilder(prebuild info,BuildRaytracingAccelerationStructureBatched2X,RehydrateRaytracingAccelerationStructureBatched2X,CopyRaytracingAccelerationStructure; slots0x6793f98/f88/fa0/f90of this exe) at logging wrappers.What the calls show:
dest=0xcc1e00100 source=0xcc1e00100 kind=1 descs=25. dest == source, at page+0x100, and the fifth argument is an array of CPU addresses of the same structures:0x6c1e00100, the-0x6_0000_0000twin. So the library gets both views: GPU addresses for its programs, CPU addresses for its own reads.0x50apart (dest, {kind, flags}, NumDescs, pGeometry, source, scratch = 0x100b620000, …). The dests are packed (0xd7227a400,0xd7227b400, …). Prebuild answers are small (e.g.result_max 0xc00, scratch 0x4494for one geometry).The match: all 323 rehydrate dests are
caa78b8cwindow bases (its root 2). Socaa78b8cis the in-place rehydration stage, and the windows from follow-ups 6–8 are rehydrations. Set against the next rehydrated structure in address order, 48 of 323 write nodes past its start:Every lane of every group stores a node (follow-up 8), so 16 groups in a 12 KiB slot would corrupt memory on the console too. The group counts are therefore the suspect. The library computes them on the CPU from the structure's serialized header, which it reads through the CPU address. That header comes from the
*_bvh4.rpfpacks through DirectStorage (core_bvh4,story000_bvh4,shared_minigame000_bvh4are opened in the log). If those bytes reach title memory wrong, or are read before they are complete, the counts and everything after them are wrong. That fits the same crash on AMD too.Next I'll dump the serialized header (through the CPU address) at each rehydrate, for the 48 against the rest. Diagnostics on
diag/bvh-alias.@Yorivel on GitHub · 2026-11-25 03:03 UTC · original
RTX 4090, follow-up 11: rehydrate headers look sane, and with batch-local pairing 70 of 648 rehydrations still reach the next structure.
The rehydrate wrapper now also logs the first
0x100bytes of each structure through its CPU address, before the library reads them.0x81020006, followed by plausible counts, f32 bounds and a size-like dword (dword 10). There is no visible difference between structures that overrun and ones that don't. So for these bytes the "DirectStorage delivers garbage" reading from follow-up 10 is weakened.caa78b8cdispatches recorded during its own call. Every structure had its own dispatches. 70 of 648 still have a window (c[0] + groups × 4 KiB, all lanes storing) reaching past the next structure of the same batch:Caveat: the reach exceeds dword 10 for every structure, fine ones included (e.g.
size 0x69880, reach0xc1ac0). So either dword 10 is the dehydrated size and the slot the title allocates is meant for the expanded one, or not everycaa78b8cdispatch writes nodes the way the 64-lane formula assumes. I can't separate the two without knowing how the title sizes each rehydrate slot. If someone knows where that size comes from (the rpf metadata, or a library call I haven't seen; the title importsSet64BitMortonCodesas well), that is the comparison to make.@Yorivel on GitHub · 2026-11-25 03:10 UTC · original
Root cause found (RTX 4090):
DispatchX's flag0x20means thread counts, and VIctory reads them as group countsShort version.
XboxBvhBuilderlaunches its in-place rehydration stagecaa78b8ca62bc3d6throughDispatchX(x, 1, 1, flags = 0x20).0x20isUSE_THREAD_DIMENSIONSin the GFX10 dispatch initiator: x is a number of threads.list.rsdispatch_xdrops the flags (_flags) and launches x groups of 64. Every lane of that program stores a 64-byte node unconditionally (follow-up 8), so the extra lanes write up to 64× the node area, over neighbouring structures and title objects. Those are the empty-box nodes and-1s found in the crashing objects.How it was found.
XboxBvhBuilder.dll:caa78b8c←0x153ba(3,972 dispatches),28918b71←0x15263,4ddd6f97←0x149c0,5e687674←0x14f06.0x153ba, with its inline path for a list with room: and otherwisecall [vtbl+0x280]withedx = r14d,r8d = r9d = 1,[rsp+0x20] = 0x20. That is DISPATCH_DIRECT's five dwords with the initiator0x20(bit 5,USE_THREAD_DIMENSIONS).5e687674's call at0x14f03, by contrast, computes groups itself ((N + 0x7ff) >> 11) and passes no initiator.VICTORY_BVH_CALLS, 648 structures in 41 batches, each paired with its own dispatches), the node reachc[0] + …:dest 0x70c000100, reach+0x1b1f00as groups but+0x53d00as threads, next structure at+0x100000.ceil(x/64)groups): still 21 of 648. 3,913 of 3,918 dispatches have x not a multiple of 64, so on the console the lanes past x don't run.What a fix needs.
dispatch_xwithflags & 0x20: launchceil(x / numthreads.x)(and y, z) groups.caa78b8c,28918b71and4ddd6f97contain nos_barrier(5e687674has one), so for them an early exit at entry is safe. One way: a host-computed user-data dword (likeUSER_VIEW_BIAS) holding the thread limit, and a guard on the dispatch thread id.Nothing in the fork or upstream handles thread-dimension dispatches yet (no
USE_THREAD_DIMENSIONSanywhere). This also fits the AMD crash, since it doesn't depend on wave size. I'm trying step 1 next and will report whether the title gets past the builder.@Yorivel on GitHub · 2026-11-25 03:32 UTC · original
RTX 4090, follow-up 12: a fix for the thread-dimension dispatch removes the corruption storm. One crash is left, later and different.
Implemented on
diag/bvh-alias(Yorivel/victory-fork) behindVICTORY_THREAD_DIMS=1:list.rsdispatch_x: withflags & 0x20, runceil(x / numthreads)groups (the group size is read from the pipeline's native program,ComputeIo.threads).USER_THREAD_LIMIT(0x104, next toUSER_VIEW_BIAS), holds x for these dispatches and all ones otherwise. With the switch, the translator puts a guard at the entry of every compute program:threadId.x < limit, else branch to the existing abort exit. The shader cache key covers the switch. All 52 builder programs still translate, validate and create pipelines.Results, with
VICTORY_BVH_BUILDER=1and everything else as in my earlier runs:caa78b8cgroups per dispatch0xffffffffffffffffbuilder runsWhat is left differs from run to run and is a single fault:
+0x4f3b0ac.[rbp+0xc]held0xff800000(f32-inf), used as an offset:read 0x21f68d0d0, reserved.+0xf6349,read 0xf. The objectrcx 0x12f5af1b0was written back once (relay_merge, through twin0x72f5af1b0) and lies+0x10b0into a rehydrated structure at0x72f5ae100. Its header says0x700, but itscaa78b8cdispatches already start atc0 = 0x880…0xa00and the slot runs to+0x1471000. So this looks like the CPU reading its own rehydrated structure and finding something wrong in it, not an overrun into someone else's memory.So the thread-dimension bug is real and fixed here, and it explains the bulk of #16 (the all-ones pointers). Something else is still off inside the rehydrated output. Next I'll log the original thread counts next to the converted dispatches, and the content written at the faulting object.
@Yorivel on GitHub · 2026-11-25 03:38 UTC · original
RTX 4090, follow-up 13: with the thread-dimension fix the title loads the world with the builder on and runs 67 s.
Same setup as follow-up 12 (
VICTORY_THREAD_DIMS=1), with the write-back log now keeping every write's bytes whole (<log>.bin) and the dispatch log the thread limit:builder runsat 03:35:03. The world draws (3,563 draws/frame at 03:36:09, very slow because of the logging), and the only fault comes at 03:36:10, 67 s in. Before the fix, every builder run died within 5–19 s with dozens of all-ones reads.caa78b8cdispatches carried the thread-dimension flag and ran thread-limited. None of their windows covers the crash object.The last fault:
+0x108557,read 0x7,rax 0x68ac4b400. That object was written once byrelay_merge(through0xc8ac4b3c0). The bytes around it:It lies
+0x5300past the roots of the rehydration at0xc8ac46100. Its thread-limited windows end earlier:caa78b8c(64-byte nodes atc0 + (g<<12) + tid*64) at+0x4dc0, and28918b71(128-byte box32 nodes atc0 + (g<<13) + tid*128, limits 23 and 6) at+0x4780. The snapshot arelay_mergecompares against is the copy itself at submission (take_snapshots), so this was written by a shader in that flight.Left as suspects:
5e687674(1,024 threads per group, a plainDispatchofceil(N/2048)groups, no thread limit; the largest program, probably the decoder of the serialized nodes) and4ddd6f97's-1at an offset read from the data. I'll trace5e687674's stores next.@Revens2 on GitHub · 2026-11-25 04:14 UTC · original
RTX 5070 (32-lane): Yorivel's thread-dimension fix is active here and cuts the corruption storm, but one all-ones read at
+0x8f92astill ends the run ~8 s after the builder starts. Twin-address resolution looks ruled out as a cause.Thanks to Yorivel, joroyt, CoDrift, Etr0p and the others: follow-ups 11 and 12 and the write-back traces are what made this checkable.
Setup: RTX 5070 12 GB, driver 32.0.16.2124, Windows 11 26200, diag build.
main310c6eb+ #36 (merged locally) + Yorivel'sVICTORY_THREAD_DIMScommit (2521646, cherry-picked onto current main; the only conflict was the diagnostics block indraw.rs).VICTORY_BVH_BUILDER=1, no quarantine, one session at a time. Counts only, no game data. The cherry-pick plus a small unit-tested helper (thread_groups, round-up of thread counts to groups) is onRevens2:fix/issue-16-thread-dimsif it saves anyone a rebase; I am not opening a PR on top of Yorivel's work.+0x8f92a,+0x4f38ba5,+0x27c195d,+0x2bd385b, ...)VICTORY_THREAD_DIMS=1+0x8f92ax2,+0x4f38ba5,+0x2bd385b,+0x55ceb22)VICTORY_THREAD_DIMS=1+0x8f92a, read0xffffffffffffffff)All four: process exit
-1073741819, no device removal.The switch is doing its job. A diagnostic line in run D shows the thread-dimension path taken: 44 logged dispatches, group size 64 for most of them, 32 for a few, e.g.
x=665becomes 11 groups,x=93becomes 2, instead of 665 and 93. So the "x as groups" over-launch is real on this card too, and exceptions drop from 11-13 to 1-5. It does not remove the crash: one fault at+0x8f92a(read of all ones) is left. With two runs per arm I would not claim more than "fewer faults, same end".On the twin-address idea (roots 1/2
view ... in no buffer):in no bufferis only the diagnostics line askingshadow::extent(address)whether a D3D buffer resource covers that title address. Rehydration roots point into raw title memory (dest == source, follow-up 10), so no buffer is expected. Nothing on the dispatch path classifies by that lookup. Together with follow-ups 3 and 4 (re-copying twin pages, memory above the directory: no change) and the fact that fixing the launch size removes most faults, I find no evidence that the address-to-buffer resolution is the cause.non verifie: whether a copy-back through the twin address still lands on CPU-written bytes in the remaining fault.Regression: workspace
cargo test --workspace --locked -- --test-threads=4on the branch above: 511 passed, 0 failed, 9 ignored (the new test ispipeline::tests::thread_dimensions_round_up_to_whole_groups). No in-game run past the builder (the title never reached the world in any of the four runs).Next on this card, if useful: the single remaining fault, with the builder's per-stage skip from #579 combined with thread dimensions to see whether it still needs one of the two late stages.
AI-assisted (Claude Code, Claude Sonnet 5.5): the runs are mine, on my own copy of the title.
@loftymocha on GitHub · 2026-11-25 05:30 UTC · original
RTX 5070 (32-lane), fork
main310c6eb+ #36 + #646 + #579: the builder runs, and the+0x8f92aall-ones read did not show in 2 runs. Both runs ended at two other sites. A control run with the builder off held.Setup: RTX 5070 12 GB, driver 32.0.16.1742, Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 26300, diag build. Tree:
310c6ebwith #36, #646 and #579 merged locally (no conflicts), none of Yorivel's diag commits.VICTORY_BVH_BUILDER=1,VICTORY_SHADER_LOOP_LIMIT=256, otherwise fork defaults. This tree's cache was empty (itstranslatehas no--cache), so shaders were translated at first use. Every run loads the same save (prison yard). Counts and addresses only, no game data.pipelines=53at 05:19:33, end 05:21:03 (~90 s)0x80000003(int3) atimage+0x4da6315; stack+0x4db82c0 -> +0x4ec5342 -> +0x4ec514d -> +0x4ec4fab -> +0x4ec4dda -> +0x54bf63 -> +0x673a12 -> +0x79486d -> ... -> +0x2593e91 -> +0x2592d69 -> +0x2215ecapipelines=53at 05:23:33, end 05:23:54 (~21 s)0xc0000005atimage+0x23cf683(write 0x0), stack+0x2215c35 -> +0x2215eca+0x8f92aread that Revens2 got on the same card with2521646. It just did not show here, and B1 got past the ~8 s point to about 90 s.shaders touched pages that had no copy, 0 ×no number left for another copy. With the builder on, world frames took 3 to 4.6 s. The shadow line reports 14,340 MB compared per frame in 3,585 ranges of windows outside buffers (the CPU cost described in #284). Breakpad reportedmemory.load_percent86 at the crash.f94e5d8bf4e1cf05) and index 31 (190fbf0ebe040169) were bound for the first time (frame 1322). That is only timing; I have not checked it as a cause. Marvisak/VIctory#1118 reports+0x23cf683(write 0x0) without the builder, so B2 may be unrelated to it.Next, if useful: more runs per arm, and #579's
VICTORY_BVH_SKIPbisection on the+0x4da6315int3 if it repeats.AI-assisted (Claude Code, Claude Opus 5.5): the runs are mine, on my own copy of the title. Counts, hashes and addresses from the logs only.
@loftymocha on GitHub · 2026-11-25 05:49 UTC · original
Follow-up, RTX 5070, same tree (
310c6eb+ #36 + #646 + #579): three more builder runs. The ends fall into two groups, and the+0x4da6315int3 repeats.Same setup as my comment above. Each run loads the same save, with the builder on (
pipelines=53logged in every run). The cache had been warmed by the earlier runs.0x80000003atimage+0x4da6315(stack+0x4db82c0 -> ...)0xc0000005atimage+0x23cf683, write 0x0 (stack+0x2215c35 -> +0x2215eca)0xc0000005atimage+0x4ee12b8, read 0x9fc0f522686 (nothing mapped);rax 0x800009fc0f522680, top bit set on an otherwise plausible address0x80000003atimage+0x4da6315again (stack+0x4da62b9 -> +0x51e41b6 -> ...)0xc0000005atimage+0x23cf683, write 0x0, same stack as B2+0x2593e91 -> +0x2592d69 -> +0x2215eca. Two of the three are the same int3 at+0x4da6315, reached through two different callers. None is the+0x8f92aall-ones read.+0x23cf683(Marvisak/VIctory#1118's site). My one control run without the builder did not hit it. One control is not enough to tie it to the builder.+0x8f92aread or a device removal.Next on this card, if useful: more control runs, to tell whether group 2 comes from the builder, then a
VICTORY_BVH_SKIP(#579) bisection on group 1. With group 1 ending 3 of 5 runs, each bisection step needs about 3 runs to read.AI-assisted (Claude Code, Claude Opus 5.5): the runs are mine, on my own copy of the title. Counts, hashes and addresses from the logs only.
@Curry-976 on GitHub · 2026-11-25 05:53 UTC · original
Same pattern on an RTX 4050 Laptop GPU (6 GB, 32-lane): with #487 and
VICTORY_BVH_BUILDER=1the builder runs, then the title crashes 16 s later. Before the crash, title code reads0xffffffffffffffff, and one faulting register holds0x7c00…(half-float infinity). WithVICTORY_BVH_QUARANTINE=1it still crashes (39 s), and with the builder off it holds. Details: #487AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment.
@Curry-976 on GitHub · 2026-11-25 06:09 UTC · original · edited 2026-11-25 06:12 UTC
RTX 4050 Laptop (6 GB, 32-lane), fork
main8dd30ab+ #36 + #646 + #579: the builder runs for over 4 minutes with no exception and no crash. Earlier, #487 alone crashed 16 s after the builder started on this card.Setup
8dd30abwith #36, #646 and #579 merged locally (no conflicts). #487 conflicts with #36 and #646, so it is not in this tree.VICTORY_BVH_BUILDER=1 VICTORY_RELAY=2.Result
the ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53at 06:04:30. The log was still going at 06:08:32 with 0 first-chance exceptions and no breakpad report. No device removal. The run went from the opening cutscene into the prison yard.shaders touched pages that had no copyno number left for another copy; its pages read zeros COPIES=1023a descriptor read only as data is not supportedEarlier on this card, with #487 at
f147507(report)+0x8f92aall-ones read among the sites.So on this card too, #36 + #646 remove the early crash, as loftymocha saw on an RTX 5070.
Not tested
Update: the shadowed areas do get light with the builder on. In the same prison-yard shot, the player at the window looking out over the yard, I compared this run against the #487 builder-off control on the same card:
So on this card, the builder and the traces together put indirect light on screen, not only "no crash". Caveat: the image looks washed out and pinkish, with heavy haze. That may be partly wrong lighting from the zero-reading pages (
COPIES=1023was reached), or it may be correct for that time of day. I can't tell without a reference. The two trees also differ: the builder-on tree lacks #487's shader programs. That explains some of the hair and cloth difference, but not the light in the shaded areas.AI-assisted (Claude Code, Claude Opus 5.5): the runs are mine, on my own copy of the title. Counts, addresses and timings from the logs only.
@loftymocha on GitHub · 2026-11-25 06:23 UTC · original
RTX 5070, first
VICTORY_BVH_SKIP(#579) arms on the same tree: with the four rehydrate-stage pipelines dropped (indices 47-50), the in-world crash did not come back, and 2 of 3 runs held 4 min in the world with the rest of the builder running.Same tree and settings as my two comments above. An unattended runner started each run and stopped it 240 s after
the ray-tracing structure builder runs, or recorded how the title ended. Indices are #579's creation indices. I picked the arms by first-bind order in B4's log. The first batch at frame 1562 is 17 pipelines. Then come 47 (4ddd6f97), 48 (5e687674), 50 (28918b71) and 49 (caa78b8c), the programs Yorivel traces above. 14 later pipelines follow.VICTORY_BVH_SKIP+0x4da6315x2,+0x4ee12b8), 2 of 5+0x23cf683, 0 held 4 min8-10,12,16-18,30-32,35,39,41,51+0x23cf683, 50 s, loading+0x23cf683, 50 s, loading+0x23cf683, 85 s, in the world47-50+0x23cf683, 65 s, loading47-50run shows only those four skipped: 166.2/frame (49), 93.8 (50), 27.4 (47), 27.4 (48). No other builder pipeline appears in it, so the other builder stages ran.+0x2593e91 -> +0x2592d69 -> +0x2215eca) did not occur in any of the 6 skip runs. With the rehydrate stage off, two runs reached the 4 min cap, which no full-builder run did. That fits Yorivel's reading that the CPU trips over what the rehydration writes.+0x23cf683before or around the time the in-world crash usually comes (90-196 s).+0x23cf683(write 0x0) ended 6 of 11 builder runs across all arms, once in the world (85 s). I count it as a separate problem (Marvisak/VIctory#1118). My single control run without the builder did not hit it, but one run is not enough.Small numbers (3 runs per arm), so this is a lead. Next on this card, if useful: each of 47, 48, 49 and 50 dropped on its own, 3 runs each, to see which one the in-world crash needs.
AI-assisted (Claude Code, Claude Opus 5.5): the runs are mine, on my own copy of the title. Counts, indices, hashes and addresses from the logs only.
@Revens2 on GitHub · 2026-11-25 06:28 UTC · original
Thanks, loftymocha: this lines up with our own bisection on the same card (RTX 5070, with #36 and VICTORY_THREAD_DIMS=1). Skipping only builder indices 49 (
caa78b8c) and 50 (28918b71) also removed the in-world crash for us for about 100 s, and either one alone brought it back. Your arm with 47-50 dropped holding 240 s in the world in 2 of 3 runs says the same thing with better statistics.What this does not tell us: dropping those pipelines also drops what they write, so "no crash" does not mean the rest of the builder output is right. The
+0x23cf683stop at 50-65 s in loading, which you see in the other runs, is a different site from the in-world ones, and we have not looked at it. Not verified on our side.@loftymocha on GitHub · 2026-11-25 07:45 UTC · original
RTX 5070, fork
maina26859f+ #36 + #646 + #579: with the full builder on, the title held 4 min in the world with no exception, the first time on this card. Like Curry-976's RTX 4050 result on8dd30ab, the room is still dark.Same card and settings as my comments above (RTX 5070 12 GB, driver 32.0.16.1742, Ryzen 7 7800X3D, 32 GB, Windows 11 26300, diag build,
VICTORY_SHADER_LOOP_LIMIT=256), now ona26859fwith the same three PRs merged locally (no conflicts). One run each, supervised, same save (prison yard). Counts only, no game data.pipelines=53)builder runs, no exception (stopped by the runner)310c6eb, none of my 5 full-builder runs reached 4 min (3 ended in the world at+0x4da6315/+0x4ee12b8, 2 at+0x23cf683). One run ona26859fis not proof that the in-world crash is fixed, but it fits Curry-976's 4 min on8dd30ab.shader writes looked for on the CPU per frame), the card is about 5% busy, and the process uses about 9-15 s of CPU per frame. Free physical memory went down to 0.4 GB on this 32 GB machine (64 GB page file). A 12-20 GB compare per frame is what makes the builder runs this slow and this heavy here.2cc4c197ee29e291, and the ray-traced shadow programs that do not translate, as in #512).AI-assisted (Claude Code, Claude Opus 5.5): the runs are mine, on my own copy of the title. Counts, hashes and addresses from the logs only.
@Rainmaker33 on GitHub · 2026-11-25 08:16 UTC · original
RTX 3090 (Ampere), fork
a26859f+ #36 + #646 + #579: the full builder held in the world in 2 of 2 runs, 892 s and 534 s, both stopped by me. This adds a second card and longer stretches to @loftymocha's 4 min on the same tree.Setup: RTX 3090 24 GB, driver 32.0.16.2140, Ryzen 5 8600G (6 cores / 12 threads), 31 GB RAM, Windows 11 26300, diag build (
--features diagnostics), rustc 1.98.1. The three PRs were applied as diffs ontoa26859fwith no conflicts.victory-shaderlib tests: 218 passed, 0 failed.VICTORY_BVH_BUILDER=1 VICTORY_SHADER_LOOP_LIMIT=256, plusVICTORY_RELAY=2 VICTORY_TEXTURE_NO_WAIT=1. The shader cache was warmed withtranslate --warm all. Each run loaded the game's own prologue checkpoint and was played by hand. Counts only.builder runs (pipelines=53)ERRORlines, nocrashes.logentry4ddd6f97…,5e687674…,caa78b8c…,28918b71…).windows outside buffers), against 0 with it off.a26859fwithout the three PRs.Not tested:
310c6eb, so I can't say whether this card would have crashed there as yours did;VICTORY_BVH_QUARANTINE; more than two builder runs.AI-assisted (Claude Code)
@loftymocha on GitHub · 2026-11-25 08:18 UTC · original
RTX 5070, follow-up on
main9376fd6+ #36 + #646 + #579: the full builder held 4 min in the world again, the second commit in a row. Also an offline comparison of #497 and #36.Same card, settings and save as my comments above. One supervised run per arm. Counts only, no game data.
maina26859f(above)9376fd69376fd6pipelines=53)builder runs, no exceptiona26859fand9376fd6. On310c6eb, 0 of 5 full-builder runs did.9376fd6's processor-side changes show with the builder off (about 10-20% more frames, at more draws per frame). With it on, the shadow line still reports about 12 GB compared per frame (shader writes looked for on the CPU per frame), and frame time stays about the same.#497 compared with #36 (offline,
VICTORY_HOST_MAX_WAVE=32 victory translate --liston the title's shader pack, executable and both DLLs, plain9376fd6):mainalone has 257 failing programs.main+ #497 has 254: it fixesdc78c5de69c7c155,322ed4ad832bdea6andd441b097704ab616(a first-lane read where not every lane runs, the three builder prefix-sum passes) and adds no new failure. That is the same three programs #36 fixes in my tree. I did not test the two together.AI-assisted (Claude Code, Claude Opus 5.5): the runs are mine, on my own copy of the title. Counts, hashes and addresses from the logs only.
@vladbondarenko97 on GitHub · 2026-11-25 08:22 UTC · original
RTX 3080 Ti (Ampere), fork
a26859f+ #36 + #646 + #579: full builder on, the title held 391 s in the world afterbuilder runswith no exception (stopped by the runner). Same picture as loftymocha's RTX 5070 run: it holds, but at ~0.2 fps.Machine: Windows 11, NVIDIA GeForce RTX 3080 Ti 12 GB (driver 32.0.16.1060), 64 GB page file. Diag build (
--profile diag --features diagnostics) ofa26859fwith the three PRs merged locally (no conflicts, merge2d2bf1f).VICTORY_SHADER_LOOP_LIMIT=256. Unattended runs from a fresh new game (profile only, no story save), scripted Enter. One run per arm. Counts only, no game data.pipelines=53,builder runsat +~2 min)builder runs, no exception, no WER/breakpad savea26859f+ other unrelated PRs, without #36/#646/#579)VICTORY_BVH_BUILDER=1also reachedpipelines=53, but the title crashed (breakpad/WER) about 40-60 s later, twice, with and withoutVICTORY_BVH_QUARANTINE=1. So on this card too, these three PRs are what keep it alive.AI-assisted (Claude Code, Claude Opus 5.5): runs on the owner's own copy of the title, numbers from the logs only.
@Revens2 on GitHub · 2026-11-25 09:22 UTC · original
RTX 5070 (32-lane): A/B on one tree — #646's thread-dimension handling holds 600 s with the builder on; Yorivel's
VICTORY_THREAD_DIMSvariant still ends at+0x8f92awithin seconds.Thanks to Yorivel (the
USE_THREAD_DIMENSIONSroot cause and the first fix), mynzjerko (#646), and everyone who posted traces: the A/B below only works because of them.Setup: RTX 5070 12 GB, driver 32.0.16.2124, Windows 11 26200, diag build,
VICTORY_BVH_BUILDER=1 VICTORY_RELAY=2, scripted Enter keys, one session at a time. Both arms aremaina26859f+ #36 + #579 and differ only in the thread-dimension change. Counts and log lines only, no game data.170c242), on by defaultVICTORY_THREAD_DIMS=1(2521646+ ourthread_groupshelper, cherry-picked)builder runs: run 1+0x4da6315(int3) then+0x32648e1(execute 0x0); run 2+0x8f92a(read0xffffffffffffffff) then+0x865607VICTORY_BVH_SKIP=47-50So on this card the
+0x8f92aread that survived Yorivel's fix did not appear with #646 in 2 of 2 runs, and Yorivel's variant ended early in 2 of 2 (one at+0x8f92a, the other at two different sites). Two runs per arm: a lead, not a proof.Why they may differ (reading of the code, not measured): Yorivel's variant makes lanes at or past x leave at the program entry. #646 does that only for programs without a group barrier and without the wave64-over-wave32 half exchange; for the others (the builder's 64-lane prefix-sum stages run as two host waves exchange halves through LDS with group barriers) it keeps every thread alive and masks stores, ballots and reductions instead. If lanes of the second half have left before the exchange, the lanes that stay read what the others never wrote.
non verifie: no run isolates this.Instruction census of builder pipelines 47-50 (
VICTORY_HOST_WAVE=32, all four translate and emit; counts of native instructions):4ddd6f97)v_readfirstlane3v_cmpx25e687674)s_barrier1,s_and_saveexec_b6462,v_cmpx_eq_u6428v_cvt_f32_f1640Dispatch, no thread limitcaa78b8c)v_permlanex163,v_readlane4 (lanes 0, 31, 32),s_bcnt1_i32_b64 exec1,v_mbcnt1,s_or_saveexec_b643, DPP prefix sumsv_cvt_f16_f326,v_pk_min/max_f166,v_min3/max3_f162ds_write_b16728918b71)v_cvt_f32_f166,v_pk_min/max_f166ds_read2/write2_b32With #36 none goes through the first-lane approximation any more (every wave64 program here takes the exchange form). What 49 and 50 need exactly:
s_bcnt1_i32_b64(exec)and the entryEXECballots to see the partial last wave of a thread-dimension dispatch (what #646 adds), andv_readlanelane 32 /v_permlanex16through the half exchange. I have no console oracle for these, so "translated and validated" is all I can claim for them.Not tested / not fixed here: the
+0x23cf683stop at loading (different site); correctness of the rehydrated output (the room is still dark per loftymocha and Curry-976); runs past 10 min.Integration note:
main+ #36 + #646 makescrates/victory-shader/src/emit/lower.rs528,884 bytes;cargo test --workspacethen failsxtask policy::tests::repository_passes_policy(limit 524,288;mainalone is 514,840). Everything else passes on that tree: 536 passed, 10 ignored, 1 failed (that test).I am not opening a PR from
Revens2:fix/issue-16-thread-dims: #646 covers the same flag more completely, so that branch stays as a reference only.AI-assisted (Claude Code, Claude Sonnet 5.5): the runs are mine, on my own copy of the title.
@Yorivel on GitHub · 2026-11-25 10:05 UTC · original
RTX 4090, follow-up 14: the thread-dimension fix is PR #840. Where the one remaining stray write comes from.
The fix from follow-ups 11–13 is now a clean PR on current
main: #840 (VICTORY_THREAD_DIMS=1, opt-in, without the diagnostics).On the crash that is left, three more traced runs with the fix (
VICTORY_GPUWRITE_LOG, new: each distinct (pipeline, range) a draw or dispatch declares as shader-written; plus the write-back log with full bytes and the dispatch log without a cap):Each rehydration's own stages are now clean and contiguous, checked on three structures from three runs:
5e687674:c[3] … c[3] + c[11] × 64, ending exactly at the header's size dword 10;28918b71(128-byte nodes,c0 + (g << 13) + tid × 128) andcaa78b8c(64-byte nodes) alternate, each starting where the last ended.Example
0xca1cee100:+0x180…+0xec0, then+0xf00…+0x1480,+0x1480…+0x1540,+0x1540…+0x16c0, …, ending at+0x1800.The crashing object is still overwritten once by
relay_merge, with builder data, a few KiB past the structure's end (+0x10b0twice on a 0xa40-long structure,+0x5c40on a 0x1800-long one,+0x5300on a 0x4dc0-long one). The site and offset repeat for the same structure shape (+0xf6349,read 0xf, in two runs).Only the four rehydration programs declared that memory: the rest of the 4 MiB window from their root view, since a root view has no size. No other pipeline, no address constant and no
CopyRaytracingAccelerationStructurecall (31 logged) reaches it.relay_mergewrites only bytes that differ from the copy's snapshot (merge_piece), and the snapshot is the copy itself at submission. So a shader in that flight really wrote them.None of the four programs' thread-indexed stores reaches there (the decoder's indices are
tidandtid + 1024, bounded byc[11]). What can reach any offset are the data-driven parent-link stores incaa78b8c/28918b71:s29 + ((((child << 3) & ~63) - s30) >> 4 & ~3), one dword per node. Their table normally sits in the header area (for0xca1cee100:d14 = -0x40, entries up to about+0x140). A child pointer holding something else (-1, f16 bounds) lands them anywhere in the window.So my reading of the rest: some node's child pointer is wrong before the parent-link pass runs. Either the decoder gets bad input, or a stage reads nodes before they are written. Next would be reading the GPU-side copy between stages, which none of this tooling does yet. Diagnostics and scripts are on
diag/bvh-alias(Yorivel/victory-fork).System Initand presents 100% black frames with 3 draws/frame #950System Initand presents 100% black frames with 3 draws/frame #950@m335671 on GitHub · 2026-11-25 21:57 UTC · original
RTX 4070 12 GB (32-lane): with #646 the builder held 12 minutes here, also with #799 on top, which brings up
sr_tracing:CS_Tiling_Generate_Opaque. But the room's indirect light stays black either way: the picture looks the same as with the builder off.Setup
maind510ee4+ #1093 (ambient light, left off except in the first row) + #1096. Then #646 (36a2257) merged in, and for the last row #799 (09b95ca) too.VICTORY_BVH_BUILDER=1 VICTORY_FIRSTLANE_OWN=1, plusVICTORY_INDIRECT_GATHER=1 VICTORY_CARD_REHASH_RUNS=1 VICTORY_TEXTURE_NO_WAIT=1 VICTORY_LATE_WAIT=3.runs ... pipelines=530xc0000005at+0x8f92aand others about 8 s afterbuilder runs; the title's crash reporter then triedsubmit.backtrace.io, blocked by the layerwater_shading:CS_TransmissionVolumetrics_*ones. That includessr_tracing:CS_Tiling_Generate_Opaque(2cc4c197ee29e291), refused without #799, which I expected to be what kept rays from being traced. It doesn't seem to be enough.A note for anyone testing this: #1093's ambient light, when on, overwrites the probe resolve's output, so it hides whatever the rays contribute. A run with it on showed one extra shadow on the left wall and nothing else. Leave it off when judging the builder.
Not checked: where the light is lost. It could be the tracing tiles (#799's loose-LDS form is approximate), the traversal's hits, or the resolve's inputs. I haven't looked at any intermediate target.
AI use: the runs were done on my machine. Claude Code (Claude Opus 5.5) built and ran them, read the logs and wrote this comment.