No reviewers
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!994
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-994"
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?
@PiloteCode on GitHub · 2026-11-25 15:24 UTC · original
PiloteCode:pr/ray-tracing→main· +12382 −1786 · 58 files · 61 commits · openStacked on #993 (the second translator PR), which is itself stacked on #854. This PR's commits are the 21 after
README: geometry stages, loops as the console runs them, .... It needs that PR in two places:Where the builder stands
Until now, the title died about a frame after the structure builder's first frame, on pointers of all ones read from its own objects. The cause was the layer's: it took the builder's dispatches by thread counts for group counts (below).
With the fix, in runs of our tree on an RTX 5090:
VICTORY_BVH_BUILDER=1, its trace on): no fault and no card loss. Every stage ran, none was dropped (Dec 2,516, Leaf 2,516, Box32 7,446, Box16 14,719, ReloadTriangles and Refit 26,144 each, Construct 5,618, LoadInstances 2,032 dispatches), about 200 builder dispatches a frame once the world was up. In the window scene, the hair's light is steady with the builder on. With it off, it changed from run to run: dark in two runs, lit in one, because the passes walked whatever lay in memory.This PR keeps the builder opt-in, as on
main(VICTORY_BVH_BUILDER=1), for its cost:Whether the traced passes light as the console's do is still to be compared picture by picture.
What changes
Dispatches by thread counts run only those threads (
list.rs,draw.rs,pipeline.rs,shader_cache.rs,emit/lower.rs)DispatchX(x, y, z, flags)passes the console's dispatch initiator bits as its flags. The builder setsUSE_THREAD_DIMENSIONS(0x20; 0x8020 for its wave32 programs) on its header copies (DecompressHeader), its box rehydration of pre-built structures (Box32Rehydration, Box16Rehydration) and its triangle reloads (ReloadTriangles, ReloadProcedurals). There, x, y and z count threads: the last group is cut short, and no thread past the count is launched. The layer ran them as group counts.The box stages rebuild one level of a tree a dispatch, in place, one node a thread: group g writes its 64 nodes at g x 8 KiB (4 KiB for 16-bit boxes), and a lane count read off EXEC (
WaveAllBitCount) places each node's payload. In the first frame of a crashing run they ran 272,948 and 47,026 groups where 5,983 and 4,217 were wanted, and wrote 2.2 GiB of empty nodes past their levels. Where that was put back, it lay over the title's own objects, which share those pages at a CPU view 24 GiB lower. Every crash site of that run lies inside such an overrun.dispatch_xnow makes groups of the program's console size out of the counts. Where a last group is cut short:victory_shader::emit::translate_thread_limited), made at its first such dispatch and cached under a key of its own.USER_THREAD_LIMIT,RootType::Other(0x105)), only along a dimension whose groups are more than one thread wide.The plain translation is untouched: only dispatches by thread counts whose last group is cut short use the second form.
Title memory by address made ready for the builder (
list.rs,memory.rs,host.rs,queue.rs,pipeline.rs,draw.rs)List upload memory where shaders reach it. The builder hands its stages the addresses of tables it writes into list upload memory (
allocate_upload); its header stage reads its records through them. The layer gave out blocks of the process heap at 1.5-1.8 TiB, beyond the console's 40 bits and the directory of title memory by address (below 128 GiB): the records read as zeros and no structure header was written. Upload memory now comes from 4 MiB chunks of one 512 MiB write-watched reservation between 4 GiB and 128 GiB. Each chunk is a window of memory outside buffers, copied when a list that names it is submitted. Larger requests still come from the heap.The addresses in the records of upload memory are named. The leaf rehydration reads 48-byte
D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESCrecords through a root SRV in upload memory, and loads vertices and indices through the addresses in them, which no root argument names. In one run, 638 of the 2,139 such addresses lay in no copy when the stage ran, and those leaves read zeros. Before such a dispatch, the block of upload memory each root SRV points into is looked through (16 KiB at most) for 8-byte title addresses, which are named like the dispatch's own.Copies by address declared written only for address stores. A program that reaches title memory by address declared every numbered copy written as soon as it could store anywhere. Only a program that can store through a raw address now does (a flat or global store or atomic, not to scratch, or code not all known). Of the builder's 52 programs, 11 store that way.
Copies kept current where named. Each list that ran such a program refreshed all 1,023 numbered windows (4 GiB) and, if it could store, declared them all written. With the builder's dispatches bound and not run, that alone made a median of 975 ms a frame, against 353 without the builder. Now:
VICTORY_MEMORY_ALL=1restores the old way.The structures' sizes are copied on the card. The title copies each structure's compacted size out of the builder's buffer with
CopyBufferRegion, in the list that computed it. Done on the CPU at submission, the copy took what the buffer held before the list's shaders ran. In a list whose shaders store by address, a copy whose source those shaders declared written now runs on the card behind them, and its destination is declared written. Other title copies stay on the CPU.VICTORY_CARD_TITLE_COPIES=0turns this off.Remaps after the flights.
CopyPageMappingsBatchXmaps pool pages at once, while the console does it behind the work sent before. A remap now first waits for the flights in the air whose declared writes touch its range, so their writes are not put back into pages mapped there since.VICTORY_REMAP_LAND=0turns this off.View addresses read from the view heap by slot (
descriptor/host.rs,draw.rs,emit/lower.rs)Four sun-shadow trace programs (
shadowmask:CS_TraceShadowRaysat full, half, quarter and eighth resolution) take their structure's address out of a buffer descriptor they pick from the view heap at a computed index. They stopped at "a descriptor read only as data". The host keeps, per view heap, a table of each slot's view address (SLOT_VIEW_ADDRESSES, a root SRV beside the strides), and such a load reads it. The fifth (FullAdaptive) now stops further on, at a lane mask read as data.Node tests answer no hit while the builder does not run (
emit/intersect.rs,pipeline.rs,draw.rs)The title's ray-traced passes run whether or not anything built their structures. With the builder off, they walked whatever bytes lay where the structures would be: screen-aligned dark tiles on sunlit hair, lit squares in shadow, and hair dark in some runs and lit in others.
A program with a node test now reads a host word (
USER_STRUCTURES,RootType::Other(0x106)): 1 while the builder runs whole, 0 before its first dispatch, withoutVICTORY_BVH_BUILDER=1, or once it is turned off. While it is 0, every node test answers no hit without reading the node: rays escape, and shadow rays find no occluder.VICTORY_BVH_NO_HIT=0lets them walk memory, as before.Diagnostics (diagnostics builds)
VICTORY_BVH_TRACE=<file>, written unbuffered so that a crashing run keeps it. One line per:VICTORY_BVH_DRY=1binds the builder's dispatches without running them.VICTORY_BVH_CHECK=<hash>[,<hash>]walks the structures that the header stage, and the in-place rebuild's header stage, start, once their headers are put back. It reports bad nodes: bounds not finite, inverted or outside the parent's, nodes outside the structure or reached twice.VICTORY_CRASH_MEMORY=1adds to a crash report the title memory around each register that holds a title address, and one pointer further.Switches
VICTORY_BVH_BUILDERmain=1runs the builderVICTORY_BVH_NO_HIT=0: node tests walk memory while the builder does not run, as beforeVICTORY_MEMORY_ALL=1: every numbered copy refreshed and declared written, as beforeVICTORY_CARD_TITLE_COPIES=0: the title's buffer copies all on the CPU, as beforeVICTORY_REMAP_LAND=0: remaps do not wait for flightsVICTORY_BVH_TRACE,VICTORY_BVH_DRY,VICTORY_BVH_CHECK,VICTORY_CRASH_MEMORYTested
The branch was checked as it is. The card was reserved for other work, so the tests ran on the software adapter:
cargo test -p victory-shader -- --test-threads=1withVICTORY_WARP=1: 264 passed, 5 failed, 2 ignored. The five are the ones that fail on #854's head merged withmainon the software adapter (see #993). The tests that need the title's builder DLL skip.cargo test -p victory-gpu --features diagnostics -- --test-threads=1withVICTORY_D3D12_WARP=1: 188 passed, 1 failed, 6 ignored. The failure isdepth_bounds_pipeline_loads_and_filters_draws, as on #854's head: WARP does not reject the pixels outside the depth bounds.cargo test -p victoryandcargo test -p victory-loader: passed.cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with--all-features: clean.cargo build --release -p victory,cargo build --profile diag -p victory --features diagnosticsandcargo xtask policy: pass.Offline census over the title's whole shader pack, as for #993 (
victory translate --validate --list,VICTORY_HOST_MAX_WAVE=32, CPU only: no pipelines): 25,952 of 25,953 programs translate and validate, against #993's 25,948. The four sun-shadow trace programs are the difference (compute 2,733 of 2,734). The one left is the FullAdaptive shadow-mask trace (a lane mask read as data). All 52 builder programs validate.New tests:
VICTORY_TEST_BVH_DLLpointing at the title'sXboxBvhBuilder.dll(skipped when unset), the builder's wave64 programs run in their picked and paired forms on the same inputs, and agree. With the same switch, 49 of the 52 programs translate for thread counts and validate; the three paired prefix sums are refused.The shader tests now keep one device per adapter for the whole test process. Two card test sessions had died in the driver (an access violation in
nvwgf2umx.dllon a driver thread, reading freed memory) after a test made and dropped its device.Overlaps with open pull requests
#646 handles
USE_THREAD_DIMENSIONStoo: groups bydiv_ceil, and a user-data word (USER_DISPATCH_THREADS,RootType::Other(0x104), 0 for no cap) read by the prologue of every spilled compute program. On wave64-on-wave32 hosts and in programs with barriers, #646 keeps every thread alive and predicates memory accesses, ballots and reductions. Here:#646 uses
0x104, which #993 and #834 use for the group base: one of them needs another code.#916 is the same change as "copies by address declared written only for address stores" (
stores_by_addressinpipeline.rs).#935 adds a
crates/victory-gpu/src/bvhtrace.rsof its own under the sameVICTORY_BVH_TRACEswitch, crash-report memory dumps, and a quarantine that holds. Its runs crashed 3 to 12 s after the builder's first frame. The overrun of the dispatches by thread counts, fixed here, explains such crashes. Whichever goes in second needs a merge ofbvhtrace.rsandcrash.rs.#738 and #749 keep a table of view addresses by heap slot as well. #738 uses the same slot (
SLOT_VIEW_ADDRESSES, 252) and also widens complement masks, which makes the fifth shadow-mask program translate. #749 keeps addresses, lengths and strides.#814 and #905 (live ray tracing) carry view addresses, a thread-count word and title-memory write-back changes of their own.
#823 and #601 give the whole builder pipelines on 32-lane GPUs in other ways (#854 does it with the paired form). #579 drops chosen builder pipelines (diagnostics). #607 saves the second directory lookup of a 128-byte box node.
#911 caps constant buffer views at 64 KiB. With the builder on,
mainneeds it (or an equivalent cap): without it a 1.3 MB view removed the device on an RTX 4070 about 36 s after the builder's pipelines were ready, and with it the same run went on (tested by rafaconvaitis below). Our tree has the cap.Not tested
0b0074e0) into the translator's branch: upstream's frame-rate sessions; no conflict 94c6c3ae55With loop notes (VICTORY_LOOP_NOTES=1) every program with a counted loop binds the notes as a root UAV. A vertex or mesh program that binds a UAV must say so (ShaderFlags bit 16, SFI0 0x4); without it the validator refused 62 of the 801 vertex and mesh programs of a game run translated with notes ("Flags must match usage"); with it they all validate (but the two whose outputs pass 32 KiB, as without notes). The runtime does not validate, so the game ran them as they were. Test: a vertex program writing the notes' UAV validates.A pipeline whose stream has a geometry shader was refused ("only vertex, mesh, pixel and compute stages are translated") and its draws dropped. Its geometry program now translates (the commit before): the host pipeline is the vertex program, the pixel program and the geometry program between them, its user data and views bound per stage as the others' (stage last, so the pixel stage keeps its place; no rectangle stage beside it, and none in a mesh pipeline). Its library entry has a name of its own. The translated geometry stage brings its used-resource entries like the other stages. shortcut: not run in the title yet: none of the runs so far (opening cutscene, gameplay from the user's save) drew with a geometry stage.c36971b2) into the ray-tracing branch: upstream's gathered indirect records, frame capture, card-memory windows, texture copy-back and wide loads; conflicts in draw.rs, host.rs and lib.rs 624857000cc36971b2) into the translator's branch: upstream's frame-rate sessions, frame capture, texture copy-back and wide loads; no conflict f66feef7a1c36971b2) into the second translator branch: upstream's gathered indirect records, frame capture, card-memory windows, texture copy-back and wide loads; no conflict f2d66cb813@rafaconvaitis on GitHub · 2026-11-25 15:55 UTC · original
I tested
c9ca6b2with a lean native build and a test-only keyboard input shim on another RTX 4070 12 GB (driver 616.64, Windows 11 build 26300). The run used Series X, a cold pipeline cache, andVICTORY_BVH_BUILDER=1with the remaining branch defaults.DXGI_ERROR_INVALID_CALL(0x887A0001) while the host was mirroring heap buffer views.Constant(…, 1267456), compared with the D3D12 CBV limit of 65,536 bytes. The check sampled a batch of views, so the exact failing call remains unconfirmed.This matches the symptom addressed by #911. I am testing its size cap in isolation on this head, using the same checkpoint and console profile.
@PiloteCode on GitHub · 2026-11-25 15:55 UTC · original
Thanks for running it in the title — that was the check we could not make.
It matches what we saw: with dispatches by thread counts run as thread counts, the builder runs and nothing crashes. The 3–12 s crashes you had on #935 fit the overrun: in the first frame of a crashing run, the box stages wrote about 2.2 GiB of empty nodes past their levels, over pages the title's own objects share at another CPU view.
On the cost: the 1.2–4 s frames on entering the world look like the usual arrival (texture uploads and the heap pass), which is slow with or without the builder, and the trace's writes come on top. Without the trace, in our runs on an RTX 5090, the builder cost about 88 ms of card time a frame in the window scene (160 ms against 72), which is why this PR keeps it opt-in. If you have the time, a run with
VICTORY_BVH_BUILDER=1and noVICTORY_BVH_TRACE, against the same save without the builder, would give its price on a 4070.And yes, please keep the quarantine (
HostList::quarantine) as a small PR of its own: it is independent of the overrun. If #935 dropsbvhtrace.rsand the crash-memory dump in favour of this one, the two will not conflict there, and we will look at the quarantine for our tree too.@TheoGegout on GitHub · 2026-11-25 15:47 UTC · original · edited 2026-11-25 15:56 UTC
Ran this exact branch in the title, since you could not: no crash with the builder on.
Setup. Head
c9ca6b2,cargo build --profile diag -p victory --features diagnostics, AMD Radeon RX 6800 XT (host wave lanes 32 to 64), Windows 11. That is the case your "Not tested" lists: a GPU with 64-lane waves, where the builder's wave64 programs run without the paired form, and the thread-count form ran there.VICTORY_BVH_BUILDER=1,VICTORY_BVH_TRACE=<file>,VICTORY_CRASH_MEMORY=1,VICTORY_RELAY=2. Save gameplay.Result.
mainplus the quarantine fix) the same save crashed 3 to 12 s after the builder's first frame, so the thread-count overrun fits what I saw there.caa78b8ca62bc3d616,153,28918b7150a7aad58,128,5e68767498c57eb62,744,4ddd6f9702fab2a72,744.Cost, with the trace on (it wrote 115 MB in the first 90 s):
So my #935 diagnosis (the rehydrate stages' lost reads through pointers) was describing the overrun's effects, not its cause. Happy to drop the overlapping parts of #935 (
bvhtrace.rs,crash.rs) in favour of yours. The quarantine fix (HostList::quarantine) still stands on its own if you want it.@PiloteCode on GitHub · 2026-11-25 16:02 UTC · original
@rafaconvaitis thanks — that fits a gap between this branch and the tree it came from, not the builder itself.
main(and so this branch) makes a constant buffer view of whatever size the title gives, and D3D12 allows at most 65,536 bytes (4,096 × 16). In our tree the size is clamped first:constant_bytesindescriptor/host.rstakessize.min(64 KiB)rounded up to 256, the same cap as #911. With it, the builder ran 420 s of save gameplay without a removal on our RTX 5090. This PR does not carry that cap, because it is #911's change.So with #911 on top (or merged first), the
Constant(…, 1267456)view should no longer remove the device. Your isolated test of #911 on this head will tell; if anything else shows up after it, please post it here.@HLVM04 on GitHub · 2026-11-25 16:28 UTC · original
An NVIDIA 32-lane data point (RTX 5070 Ti, driver 616.64, Windows 11, Series S profile). This PR was merged into our local tree: main
0b0074e+ #798 #783 #799 #770 #827 #845 #896 #807 #987, plus local changes. That tree carries #799's CBV size clamp.VICTORY_BVH_BUILDER=1, it ran 240 s with no crash and no device loss.VICTORY_BVH_QUARANTINE=1.Not having the 0x887A0001 removal reported above fits PiloteCode's reading that a CBV size cap (#911, or #799's clamp here) is what that run was missing. We did not test that directly.
@PiloteCode on GitHub · 2026-11-25 16:36 UTC · original
@HLVM04 Thanks for the run. It confirms on a 32-lane NVIDIA card that the builder runs with this PR in your tree: 240 s with no crash and no device loss. It also fits the reading above: in a tree with a constant buffer size cap (#799's clamp here, #911 otherwise), the
0x887A0001removal did not come, though as you say that is not a direct test.On the cost, our runs point the same way. On our RTX 5090 the builder added 88 ms of card time a frame in the window scene (160 ms against 72). The opening cutscene's frame median went from 385 ms to 752 ms between two successive builds of our tree, the second with the builder on by default (it had other changes too). That is why this PR keeps the builder opt-in (
VICTORY_BVH_BUILDER=1).@TheoGegout on GitHub · 2026-11-25 16:56 UTC · original
The two runs you asked for, without the trace, on the same Radeon RX 6800 XT (same head
c9ca6b2, diag build,VICTORY_RELAY=2, same save, standing still at the same spot):VICTORY_BVH_BUILDERunsetVICTORY_BVH_BUILDER=1So about 30 ms a frame on this card (233 against 266 on average), less than the 88 ms you measured, though the second run had not quite settled.
But the second run lost the device 3 min 8 s after "the ray-tracing structure builder runs":
0x887A0006isDXGI_ERROR_DEVICE_HUNG, not the0x887A0001invalid call reported above on the RTX 4070. No exception before it. The run with the trace on (my first report) went more than 5 minutes with the builder and did not hang, so it may depend on timing. One run each so far; I can repeat it, or run withVICTORY_D3D12_DEBUG=1if that would help.(A first attempt at the run without the builder crashed inside the AMD driver's shader compiler when the system ran out of commit, unrelated to this PR; the runs above are after enlarging the page file.)
@PiloteCode on GitHub · 2026-11-25 17:01 UTC · original
@rafaconvaitis thanks, that settles it: the same head and checkpoint, with only #911's cap added, went from a removal 35.72 s after the builder's pipelines were ready to 240 s without one, and the log shows the 1,320,192-byte view cut to 65,536. So running the builder on
mainneeds #911 (or an equivalent cap); I have added that to this PR's description.@PiloteCode on GitHub · 2026-11-25 17:01 UTC · original
@TheoGegout thanks, both numbers are useful. About 30 ms a frame on an RX 6800 XT, against our 88 ms of card time on an RTX 5090, fits the builder's programs running in their own wave64 form on AMD rather than in the paired form a 32-lane GPU needs.
The hang matters more. As the description says under "Not tested", the thread-count form (threads past the counts leave at entry,
USER_THREAD_LIMIT) has not been run by us on a 64-lane GPU: on AMD the builder's wave64 programs take that form natively, so this is the first run of it there.0x887A0006with nothing before it fits a dispatch that never finishes.If you can repeat it, a diagnostics build with
VICTORY_D3D12_DRED=1would say which command the card was on when it hung (breadcrumbs and page-fault data in the removal report), at much less cost than the debug layer, which may hide a timing-dependent hang. Running the same save once more with the trace on would also tell whether the trace's extra time is what kept your first run alive.@rafaconvaitis on GitHub · 2026-11-25 16:45 UTC · original · edited 2026-11-25 17:07 UTC
I ran the direct #911 comparison on the same RTX 4070 12 GB (616.64). Both runs used the same Series X checkpoint,
c9ca6b2with the same input-only shim, cold pipeline caches, andVICTORY_BVH_BUILDER=1. The second run added only the1087538CBV cap.0x887A000135.72 s after the 53 builder pipelines were ready.A separate warm-cache run reached the cell, responded to camera and movement, and reached the prompt to talk to the companion. It closed at 735.78 s after builder readiness with no device removal. Median was 2.0 fps across 67 samples with at least 4,500 draws and no pending pipelines. Strong window glare and dark room surfaces were still visible.
For anyone using Codex to test the renderer, its UI showed the “This content can’t be shown” Daybreak safety banner during this graphics session. I left a report in openai/codex#63232. If you have seen the same banner during graphics work, adding the client version and context there may help the Codex team investigate.
@oz-stanislav-zhukov on GitHub · 2026-11-25 17:20 UTC · original
Another 32-lane NVIDIA data point, this time on Windows 10 (Agility SDK): RTX 5060 Ti 16 GB, i7-14700KF, Series X profile. This PR was merged into our tree:
a253706+0b0074e+ #854 #959 + Belobug's ambient pass. That tree has no CBV size cap (#911 / #799).VICTORY_BVH_BUILDER=1: "the ray-tracing structure builder runs ... pipelines=53", ~11 min including world entry and the cell, no crash and no device removal. Before this PR the same tree crashed at world entry, reading0xffffffffffffffffin the title. I don't know why the missing CBV cap didn't bite here. It may just not have hit a large view in that stretch.CS_ScreenProbes_TemporalResolve, as in #917) still ran (shaded=truein the log), so the traced passes seem to darken what it adds. Is that expected while the structures are only partly right, or does it point at something the traced passes read?We keep the builder off for now. The PR is still worth taking for the crash fix alone.
AI-assisted (Claude Code, Claude Opus 5.5); no game data.
@Zayfway on GitHub · 2026-11-25 17:25 UTC · original
Ran this branch as published (
c9ca6b2) on a mid-range card with little RAM. AI-assisted (Claude Code); every number below is from these runs.Machine: RTX 3060 12 GB (driver 610.88, 32-lane), Ryzen 7 5700X, 16 GB RAM with a 32 GB pagefile, Windows 11 26300, Series X profile, diag build.
Translation.
translate --warm allover the shader pack: 25,950 of 25,985 translate (35 do not). Onmain(0b0074e) and on #980 it is 25,707 (278 do not).In the game. Opening cutscene, two runs back to back with the same switches (
ASYNC_SUBMIT QUEUE2 TEXTURE_NO_WAIT COPY_PLAIN LEVELS_ON_DEMAND), measured from world +60 s:VICTORY_BVH_BUILDER=1(andVICTORY_BVH_TRACE)runs ... pipelines=530x80000003)For comparison, on the same machine #980 with the builder on died at world +95–146 s: shaders touched pages from 0x10000, then
E_OUTOFMEMORY. Here the builder ran about 4 times longer and none of those messages appeared. That matches your diagnosis of the thread-count dispatches.Not tested:
VICTORY_BVH_TRACEwas on (a 250 MB file), which also costs time.@PiloteCode on GitHub · 2026-11-25 17:29 UTC · original
@oz-stanislav-zhukov thanks — a third 32-lane card where the crash at world entry is gone, and an 11-minute run.
On the darker picture: we have not compared the lit passes against the console's yet (the description says so), so we cannot say which of your two pictures is right. Two things to keep apart:
If parts look wrong rather than just darker (whole surfaces black, tiles, light leaking through walls),
VICTORY_BVH_CHECK=<hash>in a diagnostics build walks the structures the header stage starts and reports bad nodes; that would tell a structure fault from a lighting difference.@PiloteCode on GitHub · 2026-11-25 17:29 UTC · original
@Zayfway thanks — useful on a 12 GB card with 16 GB of RAM. The translation count is in line with our CPU census of this head (all but one shadow-mask trace program in the shader pack), and the builder outliving #980's run by a long way fits the thread-count overrun being the cause there.
The frame cost here is mostly the trace and the card: with
VICTORY_BVH_TRACEon, every builder dispatch and every range put back is written out (your 250 MB file), and at 0.6 fps the cutscene skips its shots, so a run without the trace is the one to compare.0x80000003is a breakpoint instruction in the title, not a fault of ours; the title reaches one when one of its own checks fails. The lines just before it in the log (and the crash report's title address, if one was written) would say where. If it shows up again without the trace, please post those lines.@Zayfway on GitHub · 2026-11-25 18:25 UTC · original
Follow-up: what ends builder-on runs on a 16 GB machine is the card's shared (system) memory budget, not commit and not VRAM. AI-assisted (Claude Code); numbers from these runs.
Same machine as above (RTX 3060 12 GB, 16 GB RAM, 32 GB pagefile), this branch (
c9ca6b2), loading the prison save.VICTORY_WINDOW_KB=256 VICTORY_WINDOW_TAILS=1a host state prelude did not record (0x8007000E)before the gameplay windownvwgf2umx.dllbefore the gameplay windowDXGI gives the card a non-local budget of about half the RAM. On a 16 GB machine that is 7.5 GB, and a larger pagefile does not move it.
What fills it, from the last memory lines of the 256 KiB run:
So on 16 GB the builder needs its by-address reads to cost less shared memory. One option is windows sized to what the shaders read rather than to the cell's end. Another is copies for builder-only memory kept on the card (it is written by shaders, not the CPU). I have not tried either. This is also what ended my #980 runs:
no shared buffer ... 0x8007000E.@PiloteCode on GitHub · 2026-11-25 18:29 UTC · original
@Zayfway thanks, that is a clear account, and it is a real limit of this PR on 16 GB: we only ran the builder on a machine with 64 GB, where the shared budget is 32 GB, so we never met it.
Your reading matches the code. A window asked for without a length runs to the end of its 4 MiB cell, and windows over the same title memory are separate copies in the PC's memory shared with the card; the builder names far more windows than the passes without it. Both of your options are sound; the second (copies of memory only shaders write kept in the card's own memory) removes the most, and the first (windows sized to what the shaders read) is the smaller change. Neither is in this PR, which only makes the builder run without the overrun; it stays opt-in.
Until then, on 16 GB the builder is likely to stay out of reach; with it off this PR should cost no shared memory beyond
main's (your 8-minute run fits that).@Zayfway on GitHub · 2026-11-25 19:14 UTC · original
Correction to my last comment: the 32 MB write-combined blocks are not command allocators. Builder-off runs on the same machine show it.
main465b94fSo the shared memory is the host copies of title memory themselves, and the builder's by-address windows come on top of a base of about 5.7 GB. The 2.1 GB of overlap between windows (5,103 MB of windows over 3,008 MB of title memory) is what an address-keyed layout would remove: windows as views into one reserved buffer per title range, mapped a tile at a time, as XCL's sparse windows do. I have not tried that here.
On a 16 GB machine that is the difference between staying under the ~7.5 GB budget and not.
@deadkid14 on GitHub · 2026-11-25 19:22 UTC · original
Linux/Proton report: with this stack, the game crashes in vkd3d-proton during pipeline creation at world entry, 3 runs out of 3. #854 on its own is fine on the same machine.
Setup: RTX 5070 Ti, driver 620.73.04, GE-Proton11-14 (its own vkd3d-proton), main
d510ee4plus our two Linux patches (DXC fallback from #20, the watchdog switch from upstream #454). Merged on top of that: #854, then this PR including #993. There was one conflict, indraw.rs(may_storefrom main next totrace_dispatchfrom here), resolved by keeping both. The structure builder was off (default) in every run.Crash:
0xc0000005 at d3d12core.dll+0x28c726 (read 0x130: nothing mapped there)on a pipeline worker. It happens about a minute into the world (frames 1092 to 1784), while the first gameplay pipelines are being made:Xid 0, no device loss. The title's crash handler then runs (its upload is blocked by the layer).
Ruled out:
VICTORY_LIBRARY_LOCK=1: same crash, same address, so it is not two library calls at once.26cc0a3(host pipelines for geometry stages): same crash.Control: the same tree with #854 only (no #993/#994) ran twice without a crash. All five programs that were dropped before now bind (
f133e35efed2a48a,02384a60fda6f2d0,2cc4c197ee29e291,2da4beb386509b77,369cbe906ea72764), at about 5 fps, the same as without it. The skin-coloured blocks on characters are unchanged there, which is why I wanted to try the no-hit node tests from this PR.So the crash comes from something in #993/#994 other than
26cc0a3. Candidates by commit title:d70b069(UAVs declared at every stage) and82a0374(mesh programs without a pixel program). I haven't bisected further.AI-assisted: Claude Code ran the builds and tests on my machine, read the logs and wrote this comment; posted at my request.
@Exopus-0x65f7ad0 on GitHub · 2026-11-25 19:43 UTC · original
Data point on 16 GB of RAM (RTX 5060 Ti 8 GB, Windows 11), PR head
c9ca6b2as is, withVICTORY_BVH_BUILDER=1. The builder starts (53/53 programs) and the game runs at 0.2-0.6 fps. Run 1 (cold cache): access violation innvwgf2umx.dllbefore the cutscene. Run 2 (warm): ends without a message 67 s after the builder starts. Run 3:E_OUTOFMEMORY("host copies in the card's memory could not be brought up to date") 2 min 20 after the builder starts, then device removed. That matches Zayfway's analysis of the shared-memory budget (about half the RAM). On 16 GB the builder is out of reach for now, as you said.🤖 Generated with Claude Code
@Zayfway on GitHub · 2026-11-25 19:52 UTC · original
Picture check on the same 32-lane card, builder off. This branch merged onto
main465b94fwith #1002 (tree:Zayfway/victory-fork@integ/rtx3060, conflicts described in #1002) gives the following in the prison scene:main, and onmain+ #1002 alone.The cost on this card is 264–274 → 338 ms a frame (GPU 150–167 → 210 ms), as the four formerly refused programs now run in their exact 64-lane forms. Details and numbers: #1002. AI-assisted (Claude Code).
@Yorivel on GitHub · 2026-11-25 21:53 UTC · original
AI-assisted (Claude Code). Numbers and log lines only, no game data.
RTX 4090 with this stack and the builder on: no crash, no device loss, 4.5 fps in the barracks, and the picture is clean.
Setup. RTX 4090 (32-lane waves), driver 621.40, i9-14900K, 64 GB, Windows 11, Series X profile, diagnostics build. Tree: fork
main085ee7c+ this PR (c9ca6b2) + #500 + #501. Merging this PR into085ee7chad one conflict, indraw.rs:may_storefrom main andtrace_dispatchfrom here sit at the same spot, and both were kept. Switches:VICTORY_BVH_BUILDER=1,RELAY=2,SHADER_OPT=0,LDS_EXACT=1,SHADER_LOOP_LIMIT=256, plus the README's speed set (ASYNC_SUBMIT,QUEUE2,INDIRECT_WINDOW,INDIRECT_GATHER,CARD_REHASH_RUNS,TEXTURE_NO_WAIT).Stability. Six launches today on this tree, 3 to 10 minutes each (four of them cold-cache starts). Every one had 0 first-chance exceptions and no device removal. Each launch logged
the ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53.Frame time in the barracks, once loading settled:
085ee7c+ #646 + #346 + #156 + #36 (no #854/#993)Windows outside buffers compared on the CPU came to 544-600 MB a frame, in 136-150 ranges. Before #346 or this PR's raw-store rule it was 16.1 GB in 4,028 ranges, at 0.3 fps.
What changed in the picture against the tree without #854/#993. Same save, same spots:
f133e35efed2a48aevery frame and had02384a60fda6f2d0,2cc4c197ee29e291and2da4beb386509b77refused. This stack builds all four.VICTORY_WAVE_PAIRS=0on this tree brings the edges back. It also turns the builder off:dropped 332.0/frame without a host pipeline: a stage of the ray-tracing structure builder, which is off. So the three builder programs that need the paired form are needed on this card too.The indirect diffuse chain runs whole. The run bound 81 programs of
indirect_diffuse_lightingandindirect_light_probes: screen probes, ray binning,CS_ScreenProbes_TraceRays_RayBinning_BVH_Mixed_ShaderBinning_WithFar, the irradiance cache and bothCS_FinalGathervariants. None was dropped. Their forms withVICTORY_WAVE_WHY=1:CS_IrradianceCache_Shade,_ShadeSecondary,_IntegrateIrradianceSH;RegisterAllocationRequestsandCS_GenerateRayBinOffsets;In two
VICTORY_SHOTframes, the final image (R10G10B10A2, 2560x1440) has smooth shading on hair and skin, and bounce light on the walls and floor away from the window. No console reference has been compared yet.A pitfall for anyone judging pictures by screenshot. A plain desktop capture (GDI
CopyFromScreen) of this window showed heavy posterization: flat colour bands on faces and clothes. Neither the screen nor theVICTORY_SHOTfinal image showed it. Use the frame shot for pictures, not a desktop grab.@PiloteCode on GitHub · 2026-11-25 22:11 UTC · original
Merged
main(c36971b) into the branch: a merge commit on top of the commits already here (6248570), then one lint commit. The branch merges intomainwithout a conflict again. It still holds #993's and #854's heads as they were.Conflicts. Four places in three files, each one where both sides had added lines. Both sides are kept in all of them:
draw.rs: a method each afterState::list_dropped_roots(trace_dispatchhere,may_storeonmain).host.rs, twice: a diagnostics statement each under one attribute line, inrun_deferred's title copy and at the top ofwrite_mapped(the builder's trace line here,main'sbackreadscalls). Each has its own attribute now, andmain's statement stays next to the copy or the write it marks.lib.rs: a diagnostics module each under one attribute line (bvhtracehere,backreadsonmain).Merged without a conflict, and read through where both sides changed the same code:
indirect.rs: the clamp's shader now hasmain's gathered records (a record's place read from a table) and #993's split dispatch (kind 3). Only a windowed draw's record is gathered, never a dispatch's, so the two do not meet. The tests of both pass.draw.rs:execute_indirectends the list's gathering for a dispatch before the split clamp, and a dispatch by thread counts goes throughdispatch, which ends it too. A title copy run on the card (copy_on_card) follows a draw or dispatch of its list that stores by address, so the list no longer gathers by then.main's loads of four dwords a call (VICTORY_SHADER_OPTbit 64, not in the default) sit beside this stack's forms.main's test of them passes here both ways, and the shader tests give the same result withVICTORY_SHADER_OPT=127.emit/lower.rsis 519,626 bytes of the policy's 524,288.Not run together: this branch with
main's newer switches on (VICTORY_INDIRECT_GATHER,VICTORY_JOIN_PARTS,VICTORY_WINDOW_UPLOAD,VICTORY_COPY_CHANGED,VICTORY_CARD_BUFFERS_MIN_KB,VICTORY_TEXTURE_BACK). Two things from reading the code:VICTORY_WINDOW_UPLOAD=1rests on no shader writing a window outside buffers. WithVICTORY_BVH_BUILDER=1the builder's programs store by address into such windows.VICTORY_REMAP_LAND, on by default).main's notes now count some 850 remaps in a frame that streams; the wait has not been timed there.Added after the merge: one lint commit for
main's newer code, the same as on our other open branches:map_entryinfpsbox.rs,collapsible_ifinpipeline/library.rs,manual_is_multiple_ofinqueue.rs,shadow.rs,draw.rsandwatch.rs. Without itcargo clippy --workspace --all-targets --locked -- -D warningsfails onc36971b, with or without--all-features.Checked, the branch as it is (
1ffff57), every test on the software adapter:cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with--all-features: clean.cargo xtask policy,cargo build --release -p victoryandcargo build --profile diag -p victory --features diagnostics: pass.cargo test -p victory-shader -- --test-threads=1withVICTORY_WARP=1: 265 passed, 5 failed, 2 ignored. The five are the ones the description names; four of them fail onmainalone on the software adapter (212 passed, 4 failed, 3 ignored), the fifth is #854's LDS subtraction test. The one test more than before ismain's new one.cargo test -p victory-gpu --features diagnostics -- --test-threads=1withVICTORY_D3D12_WARP=1: 203 passed, 1 failed, 6 ignored. The failure isdepth_bounds_pipeline_loads_and_filters_draws, as onmain(200 passed, 1 failed, 6 ignored).cargo test -p victory-hle -- --test-threads=1: 100 + 1 passed, as onmain.cargo test -p victory -p victory-loader: passed.victory translate --validate --list,VICTORY_HOST_MAX_WAVE=32, CPU only, no pipelines): 25,952 of 25,953 programs translate and validate. Its list is the same, line for line, as the one taken before the merge.@PiloteCode on GitHub · 2026-11-25 22:55 UTC · original
@BradRoland thanks, that is a real defect and your fix is the right one. With the structures off, the first look in the directory was still emitted, with a false predicate, before the branch on
built; its fault-buffer store then went to the sink word. Inside the block that tests nodes the lane's guard andbuiltboth hold by control flow, so the look needs no predicate there, and it still comes once, before the branches on the node's kind.Your commit
55f0043is on the branch as you wrote it. Checked here at that commit:cargo test -p victory-shader intersect: 8 passed on the software adapter and 8 passed on an RTX 5090, yourdisabled_structures_leave_the_page_fault_buffer_untouchedamong them;cargo clippy --workspace --all-targets --locked -- -D warnings, the same with--all-features, andcargo xtask policy: clean;victory translate --validate --list, 32-lane host): 25,952 of 25,953 programs translate and validate, as before.The missing-page fix you adapted from #1165 is not taken here: it belongs with #1165, and this PR stays what it was plus your correction.
@PiloteCode on GitHub · 2026-11-25 22:55 UTC · original
@deadkid14 thanks for the report and for what you ruled out. A read of
0x130with nothing mapped looks like a field read through a null object inside vkd3d-proton, while one pipeline is made. Of the two commits you name, the likelier one is82a0374: it makes pipelines of a mesh program with no pixel program (the title's depth passes; before it those pipelines were refused, so nothing reached the driver). On Windows such a pipeline is valid and is made; a null pixel stage is the kind of thing a translation layer may not expect.Two runs would tell:
VICTORY_MESH_LINK=0: turns that form off (those pipelines are refused again, as with #854 alone). If the crash goes, it is the mesh pipeline without a pixel shader.d70b069only changes vertex and mesh programs that have a root UAV, which withoutVICTORY_LOOP_NOTES=1are few; if the first run still crashes, the log's last "first bind"/pipeline lines before the fault would name the program.If it is the first, a stub pixel shader for those pipelines under Proton would be the way round it (the offline census already builds them that way); say so and we will add it behind a switch.
@PiloteCode on GitHub · 2026-11-25 22:55 UTC · original
@Zayfway @Exopus-0x65f7ad0 @Yorivel thanks for the three reports.
@deadkid14 on GitHub · 2026-11-26 02:14 UTC · original
@PiloteCode thanks. Results of the two checks you asked for, same tree as my report (main
d510ee4+ Linux patches + #854 + this PR):VICTORY_MESH_LINK=0does not help. Same crash, same address (d3d12core.dll+0x28c726, read0x130). With pipelines remembered from the earlier runs it now comes during loading (frame 32 to 43), or about a minute into the world.The program: I added a log line before each library load and make, with the thread, and compared what was in flight at three crashes. Each time, the crash follows the start of the make of
[compute e4a9f58e3acfcf7b]:e4a9f58e3acfcf7bmake startsThe same program builds fine in the same tree without #993/#994 (
host pipeline shaders=[compute e4a9f58e3acfcf7b], first bind at frame 1187). So the crash comes from what this stack changes in its translation, not from mesh pipelines without a pixel program.Something else turned up while looking, in both builds: four compute pipelines start and never finish on this stack (
fdd56d97a806bcca,a1b20bc47e3c9597,e8c962358d862e3f,559d9f0184e15fe3). One was still being made 95 s after it started. They are likely the ~5 draws a frame we see dropped as "being made" for a whole run. It is a separate issue, but worth knowing for anyone tuningVICTORY_PIPELINE_WAIT_MSon Linux.I can run a build that leaves
e4a9f58e3acfcf7bon its old translation, if there is a switch for the forms #993 adds.AI-assisted: Claude Code ran the builds and tests on my machine, read the logs and wrote this comment; posted at my request.
@drchef420 on GitHub · 2026-11-26 05:06 UTC · original
AI-assisted (Claude Code). Numbers and log lines only, no game data.
RTX 5070 12 GB, 32 GB RAM, builder on, no quarantine: no crash, no device loss, 6 min 17 s with the builder, and the picture looked right to the player. On
mainwithout this PR the same start crashed 8 s after the builder came up.Setup. RTX 5070 12 GB (32-lane waves, driver 610.88; an RTX 3060 in the same PC, the game on the 5070 by Windows' per-app GPU preference), Core Ultra 7 270K Plus, 32 GB with a 32 GB paging file, Windows 11 26300, Series X profile, release build (no diagnostics). Tree: fork
main988aa41+ this PR at7af465b. Switches:VICTORY_BVH_BUILDER=1 VICTORY_FIRSTLANE_OWN=1, nothing else. A new start with no save, through the opening cutscene into the first room.Merging. Since the last merge of
main(c36971b) there are ten conflicting hunks in nine files. Two are more than both-sides-added:emit/intersect.rs:mainnow has96ff135("node tests can answer no hit",VICTORY_BVH_NO_HIT=1, credited to this PR's idea, as a translation-time switch). I kept its early return before this PR'sbuiltword test.emit/mod.rs:main'sVICTORY_WAVE_WIDE=lastblock returnsagain.map(|(shader, _)| shader); with this PR's return type it isreturn again;.The rest I kept both sides of (
draw.rs,host.rs,pipeline.rs), or took this PR's side where only formatting differed (fpsbox.rs,pipeline/library.rs) andmain's comment andcfg(indirect.rs,resource.rs). With that:cargo test -p victory-shader --locked272 passed, 2 ignored;cargo test -p victory-gpu --locked -- --test-threads=1207 passed, 6 ignored.The run. 10 min 51 s; the builder came up at 3 min 30 s ("all of its programs have host pipelines", 53). From then on:
ERRORlines; the title ended normally when the window was closed (crashes.loguntouched).no number left for another copynever logged, withmain's 1023 numbers.maina183ea2the same room ran at 3-4 fps with the builder off.For comparison, without this PR.
maina183ea2, same machine, same start,VICTORY_BVH_BUILDER=1 VICTORY_FIRSTLANE_OWN=1 VICTORY_BVH_QUARANTINE=1: the title crashed about 8 s after the builder started, in the opening cutscene (a read reported at0xffffffffffffffffat+0x52eca06,rdxall ones). From a save, on earlier trees of this fork, it crashed within seconds in five more runs, with and without the quarantine.On 32 GB the builder fits for these six minutes; with shared memory still growing at the end, a longer run would tell whether it stops.
@deadkid14 on GitHub · 2026-11-26 05:26 UTC · original
Follow-up on Linux with this PR's current head (
7af465b, which includes mainc36971b), using the switches from the RTX 5070 report above:VICTORY_BVH_BUILDER=1 VICTORY_FIRSTLANE_OWN=1. On top: the watchdog switch from upstream #454, and the layer's own HLSL compiled with DXC (Wine's d3dcompiler refuses some of it).The result is the same crash as before, so
VICTORY_FIRSTLANE_OWN=1does not avoid it under vkd3d-proton (GE-Proton11-14's build, RTX 5070 Ti, driver 620.73.04):This was at frame 1268. A cached form of the same program had bound earlier at that frame, and the crash comes right after this new translation of it. No Xid and no device loss.
So on Windows the driver takes this pipeline, and under Wine vkd3d-proton fails on it with a null read. I haven't tried a newer vkd3d-proton than GE-Proton11-14's. If someone on Linux has one built from master, this program would be the one to check.
AI-assisted: Claude Code ran the builds and tests on my machine, read the logs and wrote this comment; posted at my request.
@drchef420 on GitHub · 2026-11-26 06:10 UTC · original
AI-assisted (Claude Code). Numbers and log lines only, no game data.
Correction to my comment above: the tree I tested had this PR's
COPIES = 2047, notmain's 1023. I misread the merge; the numbers there are right, the limit was not.A longer run of the same build (
988aa41+7af465b, same machine and switches, from a save): 58 min 30 s, the builder up at 3 min 40 s. No exceptions, no device removal, noERROR, no0x8007000E; the title ended normally when the window was closed (host pipeline library saved).no number left for another copy; its pages read zeros COPIES=2047at 26 min 27 s (22 min 47 s after the builder came up), after the player had moved through several areas. Shortly before, at 20 min 32 s:no free dynamic descriptor slots: a table is not made n=182anda draw whose descriptor table found no free slots is dropped(each logged once, so we can't tell how often).copying back: 220-440 ms and 50-140 MB a frame. The other half is 200-500 mson the GPU. That matches the shortcut inmemory.rs, where every such dispatch declares all numbered copies written and they are compared on the CPU.So with this PR the builder runs for an hour on 32 GB without crashing, and memory holds. The limit we hit is the copy numbers, which #1082 addresses. It conflicts with this PR only in
memory.rs; we'll report back if we run the two together.@deadkid14 on GitHub · 2026-11-26 06:44 UTC · original
Linux follow-up: with a newer vkd3d-proton the structure builder now starts here. The game then hangs about 50 s into the world.
Tree: this PR at
7af465b, plus the watchdog switch from upstream #454, the layer's HLSL compiled with DXC, and one local change: pipelines whose shaders are onVICTORY_SKIP_PIPELINESare refused when they would be made (a draw-time skip alone still makes them).VICTORY_SKIP_PIPELINES=e4a9f58e3acfcf7b(the program from my earlier reports). Switches:VICTORY_BVH_BUILDER=1 VICTORY_FIRSTLANE_OWN=1. RTX 5070 Ti, driver 620.73.04, GE-Proton11-14's Wine with a rebuilt wineserver (CachyOS/wine-cachyos#50).cae8353ed)d3d12core.dll(+0x28c726, read 0x130) at frame 1464, making mesh and pixel pipelines (36a9c81f635373e5,47848d52f85892d8,257fb752e6b64ce4were the last translated). No "structure builder runs" line before that.71cae091b(the project's CI package)the ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53.The hang with master: the last log line is
long frame 1315 at 51.7 s: 1834 ms, then nothing for 3+ minutes. Meanwhile the process uses exactly one core at 100%, the GPU is at about 6%, and there is no Xid and no device loss. So one thread spins waiting for something while the card idles. I can't tell from outside what it waits on. It looks like the builder's first results never arrive, but that is a guess. A run withVICTORY_HELPER_OWN=0on GE's vkd3d-proton hung the same way (silent log, around frame 925), before any crash.So with vkd3d-proton master the builder's own pipelines all get made, which GE-Proton11-14's build never got to. I can't say the mesh/pixel crash is gone: this run hung at frame 1315, before the frame (1464) where the earlier run crashed. The next blocker is this spin after the builder starts. If there's a trace switch that would show what the spinning thread waits for, I can run it.
AI-assisted: Claude Code ran the builds and tests on my machine, read the logs and wrote this comment; posted at my request.
@BradRoland on GitHub · 2026-11-25 22:21 UTC · original
On
crates/victory-shader/src/emit/intersect.rsline 179 (outdated):The first directory lookup is emitted before branching on
built. Passing a falsereadspredicate sends the fault-buffer store to the sink at word 0. WithUSER_STRUCTURES=0on1ffff57, a synthetic WARP dispatch of 32 lanes targeting missing page 11 changed that word from0xabcdef01to11. The page-request slot stayed zero and the box returned four misses. The extra UAV write is measurable independently of any effect on frame time.I moved the directory lookup into the existing enabled block. The test keeps the entire fault buffer intact with traversal disabled, then enables traversal and checks that page 11 is requested. It passed on WARP and the RTX 4080. Correction and regression based on this head
For testing this alongside #1165, I also adapted the missing-page fix to this branch. All nine intersection tests passed on the combined tree, including disabled traversal, fully missing boxes and boxes split across pages. Gameplay remains unverified here. Combined branch
@BradRoland on GitHub · 2026-11-25 22:21 UTC · original · reviewed
I checked the builder-off path on the updated head and found one title-memory access that still runs on a disabled traversal. The returned no-hit values themselves were correct.
@drchef420 on GitHub · 2026-11-26 08:04 UTC · original
AI-assisted (Claude Code). Numbers and log lines only, no game data.
@deadkid14 for the spin there's a switch already in this tree:
VICTORY_STACKS=<seconds>[,<seconds>...](crates/victory-loader/src/stacks.rs, started fromapps/victory/src/run.rs). At each time listed, counted from the start, it suspends every thread in turn and prints its unwound stack asmodule+rvato stderr (not the tracing log), underVIctory: stacks of N threads. With your hang at about 52 s,VICTORY_STACKS=70,100,130should catch the spinning thread three times; the frames that stay the same across the three dumps are what it waits in. It usesGetThreadContextand the same unwinder as the crash report, so I'd expect it to work under Wine, but we've only run it on Windows.The log may already narrow it. The
console CPU instructions, exceptions a second: ...line is printed only from the handler of an emulated console instruction (monitorx,mwaitx,clzero;console_insn.rs,line()), at most every 5 s. On Windows with the builder on, our 58-minute run shows a median of about 74,500monitorxa second (631 such lines after the builder came up), so that line keeps coming even when frames take seconds. If it stops in your log along with everything else, no thread is in the title'smonitorx/mwaitxwait during the hang. Then the core at 100% is a plain loop, the title's or ours, and the stacks will say which. If those lines do keep coming while frame lines stop, it is the title waiting on a value in memory that never arrives.For comparison, on Windows (RTX 5070, this PR +
main988aa41) the builder's first frames were slow but they came:0.7 fps, 1427.6 ms/frameat its start, frames of 950 to 1,450 ms for the next minute, then 450 to 650 ms. The longest gap between any two log lines in that run was 5.3 s.@HLVM04 on GitHub · 2026-11-26 08:06 UTC · original · edited 2026-11-26 08:25 UTC
An update to my 589 ms figure above, on the same RTX 5070 Ti (Series S profile, Windows 11). Our main stack now carries #993 and this PR at
c9ca6b2, plus55f0043and51700c6.VICTORY_BVH_BUILDER=1: a steady 70–77 ms a frame in the window scene (about 13–14 fps), against the 589 ms I reported on the older base. There was no crash or device loss in 2 runs of 380 s, and interiors are much better lit. Free RAM went down to 0.5–0.8 GB of 31 GB during those runs.b36c288fccc767b0) was missing from the G-buffer in 2 of 2 runs. It is also missing with the builder off whileVICTORY_REMAP_LAND,VICTORY_HELPER_OWNandVICTORY_CARD_TITLE_COPIESare on (their defaults), and it is present with those three set to 0. That is one run per setting, and we haven't yet narrowed it to one switch or found the cause.VICTORY_DISPATCH_THREADS=0together with the builder crashed at 60 s.Correction (2026-11-26): with the builder on, the skin draw was missing in both builder-on runs, including the one with
VICTORY_REMAP_LAND,VICTORY_HELPER_OWNandVICTORY_CARD_TITLE_COPIESset to 0. The "present with those three set to 0" result above was with the builder off only.AI-assisted (Claude Code).
@drchef420 on GitHub · 2026-11-26 10:41 UTC · original
AI-assisted (Claude Code). Numbers and log lines only, no game data.
Follow-up to the boat and the black surfaces in my earlier comments here and on #1082. Neither one comes from this PR.
The boat was the water copy-back being off. I suggested the boat's engine might break because pages read zeros after the copy numbers ran out. That was wrong. I ran the same part of the game four ways on main + #994 + #1082 (da19199):
VICTORY_TEXTURE_BACK1VICTORY_BVH_BUILDER=1 VICTORY_FIRSTLANE_OWN=1)1This is the known water bug (#863, #1034): the boat floats on wave heights the GPU writes, and without the copy-back the CPU reads nothing there. With the copy-back on, the builder doesn't change anything at the boat. The four water textures were copied back 646 times in the builder run. There was one
a texture copied back could not be tiled e=Unsupportedwarning in each run; we saw no effect from it.The black surfaces aren't from the builder either. Surfaces in shade (house walls, a wheelbarrow, parts of the dock, the building at the camp) come out flat black. They look the same with the builder on or off, so it's something else.
Still open: one indoor scene at the camp (the "Press X to fight" prompt) came out washed white with smeared streaks. That was with the builder on; I don't have the same moment with it off yet, so I can't say whether the builder is involved.
Cost of the builder in the same place: with it, frames took about 340–770 ms; without it, about 290–450 ms (RTX 5070, 32 GB PC). #1082's reclaim kept the run going after the copy numbers ran out at +28 min (7 give-backs, no crash).
@HyperEndgame on GitHub · 2026-11-26 17:18 UTC · original
With the builder on (
VICTORY_BVH_BUILDER=1), no trace program ever reaches a node test on our card. The cause is the user-data view-address path. The 3-line fix below makes the walk run.Setup
085ee7c+ #854 + #993 + this PR + #213 + #1147 + #1084. Diag build.VICTORY_BVH_BUILDER=1 VICTORY_RAY_PROBE=1. Scripted input, 7–9 min runs.What we saw
Memorynodes;image_bvh.a shader takes the address of a buffer view that is not there: it reads 0 slot=1 dword=8.BVH_CHECKshows the builder does produce structures: hundreds a frame, tens of thousands of box nodes, about 3–6% bad nodes. So the walkers were reading base 0, not an unbuilt structure.Cause
host_word,USER_VIEW_ADDRESSpath (draw.rs), decodes the table entry withbuffer_rangeonly. AView::Shaderwith dimensionRAYTRACING_ACCELERATION_STRUCTUREgivesNone, so the result is 0. The heap-index path (SLOT_VIEW_ADDRESSES) already goes throughview_address, which handles structure views.Fix
After the fix (same switches)
missing0–9k.Not tested
@HyperEndgame on GitHub · 2026-11-26 17:55 UTC · original
Correction to the cost numbers above: the 0.1–0.6 fps was measured with
VICTORY_RAY_PROBE=1. The probe's per-node atomics, all to the same few dwords, were nearly all of it.With the probe off, same build and switches (
VICTORY_CARD_METER_PIPELINES=1, one 8-min run):VICTORY_SHADER_LOOP_LIMIT=trace:128the frame rate stays the same, andVICTORY_LOOP_NOTES=1shows only 3–13 lanes reaching the limit. So there is no long tail of runaway walks.@KyleS98 on GitHub · 2026-11-26 18:09 UTC · original
An RTX 3090 Ti data point (32-lane, 24 GB; 62 GB RAM, Windows 11), this PR at
7af465bwith only #911's cap (1087538) on top. Diagnostics build, release profile, a new start through the opening into the prologue cell, 6-minute runs, one per row.As published, Series X profile (
VICTORY_FIRSTLANE_OWN=1, otherwise defaults):VICTORY_BVH_BUILDER=1The builder came up with all 53 pipelines and ran 4 min 38 s to the run's limit. On
mainbefore the thread-count fix, every builder run of mine ended within seconds.With the README's speed switches (
INDIRECT_WINDOW JOIN_PARTS BACK_OWN_VIEW INDIRECT_GATHER CARD_REHASH_RUNS LEVELS_ON_DEMAND ASYNC_SUBMIT QUEUE2 TEXTURE_NO_WAIT COPY_PLAIN,MERGE_GAP=64 MERGE_RUNS=4096 STAGING_POOL=0,CARD_BUFFERS_MIN_KB=64 CARD_BUFFERS_MB=1280), Series X: about 152 ms with the builder off and about 280 ms with it on, again with no exception and no removal. So here the builder costs about 60 ms a frame at the defaults and about 130 ms with the speed set.Picture with the builder off (the no-hit node tests), same shot of the cell from behind, against
maine4245f3with #798 (Series S profile) on the same card; the Series S tree below shows the same three things as Series X:mainit comes out pale blond;mainthe pane is clear;mainit is lit in bands.With the builder on, the top of the head and the shoulders are darker, with a rim of light from the window. I have not compared either against the console.
Series S needs #798 on this base to show the world, so those runs are of a tree of mine (this PR + #911 + #798 + #1081 + our speed commits): about 81 ms a frame in the same shot, hair and window as above. One difference from Series X on the same build: the print on the back of the character's shirt is missing on Series S in 4 of 4 runs and there in 2 of 2 on Series X.
VICTORY_REMAP_LAND=0 VICTORY_HELPER_OWN=0 VICTORY_CARD_TITLE_COPIES=0(HLVM04's three, above) did not bring it back in one run. I do not know yet whether that comes from this PR.Memory, for others with background apps open: the working set's peak comes at world entry with or without the builder (39 GB against 40.8 GB); the builder adds about 4 GB once settled.
AI-assisted (Claude Code, Claude Fable 5.2). Numbers and descriptions only, no game data.
@Swagi-REDACTED on GitHub · 2026-11-26 20:09 UTC · original
Local integration test of #994 at
72e50a10aaa32adfa4e8d8f948c1ecdd037f6f59in my fork (includes #1002, the small #1112 translator fixes, #1205 and live input). This is an integration result, not an isolated comparison of this PR.Hardware: Ryzen 7 9800X3D, 16 GB system RAM, RTX 3060 12 GB, NVIDIA 621.14, Windows 11. A newer retail game remained on an HDD; cache/profile were on SSD. Series X profile, builder enabled, D3D12 debug layer and input/BVH tracing enabled; no ambient substitute, shader skips, quarantine or dry builder mode.
Runtime, 2026-11-26 19:40–20:05 UTC:
Validation of the tested integration:
cargo test --locked --workspace -- --test-threads=4 --nocapture: 690 passed, 0 failed, 12 ignored, with 10 explicit skipped/not-run cases (two queue2 adapter checks, two unset local builder DLL tests, four compiler checks and two WARP limitations). Separate local builder-DLL tests: 4 passed, 0 failed, 0 ignored. Diagnostics build passed. Offline builder validation/pipeline creation: 52/52 on NVIDIA; runtime then reported 53 ready pipelines. A previous parallel GPU test attempt crashed in d3d10warp.dll; serial and repeated parallel GPU tests and the final workspace run passed, but that crash has no proven root cause.AI use: Codex, GPT-6 (exact serving variant not exposed), integrated the existing changes, ran the tests and local runtime checks, and wrote this report. No game data or raw traces are attached.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.