Allegory of the CaVI : RE notes. #2609
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2609
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?
@fubukiclears on GitHub · 2026-11-25 16:45 UTC · original
How a GTX 1660 SUPER walks into a ray-traced prison: test report + RE notes from the exe
Hey all. Huge respect to everyone grinding on this: the fxceless fork, VIcky, VItoriaBr and everyone filing those beautifully detailed reports. This is my way of paying some of that back.
I've been pulling apart
game_scarlett_master.exe1.0.2.1 statically, and I'm dropping everything below so nobody has to rediscover it. All addresses are RVAs (ImageBase 0x140000000; add whatever base your runtime maps it at). No game data in here, just addresses and behaviour.1. The underdog report: GTX 1660 SUPER (Turing, 6 GB, zero RT cores, 32-lane waves)
Yes, the card everyone forgot about. It runs.
9376fd6+ Xeltax/VIckyfx-heapmap-8d+ fork PR #86 (PC FidelityFX) + fork PR #610 (TEXTURE_DROP_MIPS), Series S profile.What actually mattered on a 6 GB card:
--console series-s: render targets ~1.35 GB instead of ~3 GB. On a small card this isn't optional.VICTORY_SHADER_OPT=0, the 14 cascade-shadow hashes inVICTORY_WAVE_DEEP_SKIPS_NOT(from VIcky's README — without them 32-lane GPUs drop walls/ceilings and break shadows), andVICTORY_SHADER_LOOP_LIMIT=16384(keeps runaway loops from freezing the PC without smearing hair like32does).VICTORY_LEVELS_ON_DEMAND=1,VICTORY_CARD_ROOM_FOR_TARGETS_MB=1500(the 3,072 default is sized for Series X and quietly starves textures on S),VICTORY_TEXTURE_ROOM_PERCENT=94.VICTORY_TEXTURE_DROP_MIPS=1(PR #610). This one's the black-face fix. Without it ~20,000 textures (10 GB) sat waiting for room, the main character's head among them, so you got a lit body with a black head. Fun detail: another inmate's face went black the exact moment the camera got close enough to ask for her bigger texture. Not lighting, not the skin shader: just no room.VICTORY_CARD_FETCH_INFLIGHToff: on this card it pushed GPU time from ~100 to ~285-300 ms a frame. That matches what VItoriaBr measured on an RTX 5060 Ti, so it's not just a 1660 thing.2. The 174 MB "GPU-heap buffer" is mostly not per-frame data (for fork #650)
That 174 MB buffer everyone keeps comparing twice a frame? It's three different things glued together, and only one of them actually changes per frame.
The 185 MiB 32-bit pool is made by
0x1e86440(single caller0x5c5ff00, from0x2478440): one placeholder (XMemVirtualAlloc(..., 0x42000, attr 0x7), base[0x75df188]), physical pages fromXMemAllocatePhysicalPages(0x280), split into five attr-0x27 windows:Windows 2+3+4 are exactly that 174 MB (
0xae00000). Windows 3 and 4 barely ever change. Only window 2 is the hot one.How the ring works (window 2):
[0x75df1b8](CPU == GPU address 1:1), chunk count[0x75df1c8]= 216, chunk size[0x75df1cc]= 0x20000, chunk descriptor array[0x75df1c0](stride 0x58).0x4d9d990/0x4d9d9a0(ctx+0x12780), Async0x31b80(ctx+0x12300). Cursor fields:[ctx+0x88]current chunk descriptor,[ctx+0x90]write pointer (starts at the chunk top and goes down),[ctx+0x98]bytes left.0x2a42d0,0x607530 -> 0x24749d0;0x1f6130 -> 0x1f75eb0) each used chunk goes onto a fence-tracked queue (tail[0x75df1d8], head[0x75df1e0], mutex0x75df198) and gets stamped:[chunk+0x18]= packed fence(queueIdx << 56) | value,[chunk+0x50]= frame index[0xa9437ac].0x5c280recycles chunks once their fence completes.[write pointer .. chunk top]of the chunks a submission touched can have changed. The rest of those 174 MB doesn't need comparing or copying at all.3. Pools that never hold GPU data (stop tracking them)
Free performance, basically:
0x22163d0, 220 MiB on Series S): CPU-only engine object pools (attr 0x21, prot 4 views via0x2216390).0x5eb2780, 297 MiB on S / 710 MiB on X): render targets, depth and aliased transient GPU buffers. GPU-only, so the CPU never needs them back.4. Where every BVH byte lives (for the ray-tracing crew)
If the memory-by-address copies are what's killing the builder, here's the good news: all BVH data sits in exactly two pools.
0x71c2808(attr 0x283, 1,277 MiB on S / 2,199 MiB on X). BLAS sub-pool base[0x75a47e8], size[0xa943970](250 MiB S / 500 MiB X); scratch[0x84207b0](40 MiB S / 64 MiB X).0x1e6c110): CPU view[0x9e1dac0], GPU view[0x9e1dad0], span[0x9e1dac8]. Static BLASes are rehydrated in place here (0xea6c60/0x2490a20: dest == source + header), not copied into the BLAS pool.The builder object is
XboxBvhBuilder(device, false)at0x247944f, stored at[0x75df0a8](the bool means rehydrate-only). The batched build desc has stride 0x50; happy to share the full layout.5. The RT gate, and why "just turn RT off" won't light your rooms
0x6b4d760, indexed by[settings+0x58]via0x5451e10) only scales probe grid dim (16 -> 32), cascades (3 -> 5) and SR flags; the hardcoded feature bitmask[0x76b8fe0] = 0xDE4Fonly controls RT directional shadows (0x0004) and async-compute queue selection (0x0040->[0x840d8b2]). All probe buffers (0x0cd3b40) are pure VRAM compute UAVs — none of the 38*Storeasset stores hold baked probes or precomputed GI.0x4fd8550(HasValidTLAS) is the single check behind all 46 ray-traced call sites. Make it return 0 and every consumer takes its built-in non-RT path. I wired it up locally asVICTORY_NO_RT=1(byte-checked, so it refuses to patch the wrong build).0x93cd10turns its argument into a run flag (test edx,edx; setne dl) for0x16ef290(enqueued unconditionally withr9d = 1at0x0137692inside0x0137470), whosecl == 0branch (0x16f1bd4) skips0x3260db0(the builds). Force the flag to 0 rather than stubbing0x16ef290directly — thatcl == 0branch is the engine's own maintenance path (used by0x03c9510) and still flips the double-buffer index[0x840d8a0]and clears the[0x840d870]visibility arrays, while making ~300 dropped builder dispatches a frame vanish.CS_Primary_Gather_Fallback(81560230fcde2b0a) writes(0, 0, 0, 0)radiance +10000.0fmax distance (0x461c4000),CS_ScreenProbes_TraceRays_Fallback(a953d5b93efe8424) stores constant ray-miss sentinels (0xf8003c00/0xfffe03ff/0x0ffff800), and the secondary irradiance cache (0x357b990) has no fallback at all (only alpha probes'CS_GatherAndShadeAlpha_Fallback,29dc558346584906, actually samples sky/env cubemaps). They're null-guards for the frames before a BVH exists, not a hidden non-RT lighting mode, so rooms lit only by bounce light stay dark with or without RT on PC right now. Sorry.VICTORY_NO_RT=1, only two final-gather permutations actually bind to write the indirect-diffuse UAV read bytiled_lighting:CS_FinalGather_0_1_1_0(2dc364df5d3278b8) andCS_FinalGather_0_1_1_1(738350c1a01b713a). Clamping a small ambient floor there (or inCS_Primary_Gather_Fallback) would lift pure-bounce rooms out of#000000at zero GPU cost.voxelization, and*_Voxelspasses inindirect_diffuse_lighting,indirect_light_probesandsr_tracing). The retail exe never dispatches it (zeroGS_VoxelizeGenericgeometry shaders bind at runtime); onlyEntityCoarseVoxelization(loaded0x0cbd670, dispatched0x32af080) runs. Whoever cracks feeding those passes might get lit interiors without full RT.6. What I'm digging into next (shout if you want something else)
+0x4f28e0f(read 0x18 on a worker thread, binoculars),+0x4f46cc2and+0x4f0ed7d(both read 0xFFFFFFFFFFFFFFFF). What those functions do, and what's null or -1 when they blow up.EntityCoarseVoxelization's volume can feed the*_VoxelsGI passes.Questions, corrections, "you're wrong about X": all welcome. Let's get this thing lit.
@Marvisak on GitHub · 2026-11-25 18:48 UTC · original
Automated triage for the maintainers.
Material reverse-engineered from the title's executable and the console SDK (addresses, internal function and data layouts, SDK function names, shader names and constants) must not be posted here; this is flagged for the maintainer.
On the run report itself (GTX 1660 SUPER, Windows 11): it was made on a combination of third-party fork trees and options that main does not have, so it says nothing about main. A run report this project can use needs a run of unmodified current main with:
crashes.loglines or error textGenerated by Claude Code