Status, 2026-11-25, midday: with VICTORY_BVH_BUILDER=1 rooms get their
indirect light (runs light-10, light-11, n19), for some 40 ms more of the
card's time a frame (the dorm: 75 of 90 ms busy against 34 of 64). Off by
default. VICTORY_AMBIENT=1 puts an estimate of that light in its place
for next to nothing (below).
The title's indirect light (probes, bounce, reflections) and the shadows of its lamps and sun are ray traced. Without them, anything the sun does not hit directly is black: interiors, the shadowed side of a face, rooms lit only by lamps.
The title does not use a ray-tracing API:
XboxBvhBuilder.dll, 52 compute
programs) builds and refits the dynamic structures on the GPU every frame.image_bvh64_intersect_ray and image_bvh_intersect_ray. One call tests a
ray against a box node's four children (returning the hit children, nearest
first) or against a triangle node (returning the intersection's numerator,
denominator and barycentric numerators).So mapping this onto the host's own ray tracing (DXR) is not practical: the layer would have to know the geometry behind structures the title never describes to it, and the traversal loops live in 64 of the title's own programs. This fork runs the title's builder and traversal as translated shaders and emulates the one instruction.
crates/victory-shader/src/bvh.rs; tests run the emitted DXIL on the GPU
over 311 ray/node cases and compare with the reference bit for bit.VICTORY_BVH_BUILDER=1 asks for it; VICTORY_BVH_QUARANTINE=1
also keeps the builder's stores out of title memory, for a first test). A
partly working builder wrote garbage bounds into title memory and crashed
the title.VICTORY_MEMORY_DUMP)memory.rs)Pages of 64 KiB in arenas on the card, whole title buffers in their own copies, pages with small title buffers as windows of title memory. The module's comment has the rules. In short: what the builder stores stays on the card (only small title buffers it was given to write come back); a packed structure goes up whole when the builder comes to it; title buffers take its stores only after it was given them as an unordered access view.
| variable | does |
|---|---|
VICTORY_BVH_BUILDER=1 |
the builder's stages run |
VICTORY_BVH_FENCES=0 |
no fences around the builder's buffer atomics (beloooo's 72e748ea has them too) |
VICTORY_BVH_SIZES_WAIT=1 |
submissions that ask for structures' sizes are waited for (off: no help, slow) |
VICTORY_BVH_BOUNDS=0 |
the builder's accesses are not bounded |
VICTORY_BVH_TRACE=1 |
logs what sizes are asked, when they came, and the copies (diagnostics) |
VICTORY_BVH_QUARANTINE=1 |
nothing it stores comes back to title memory |
VICTORY_MEMORY_CARD_MB |
the most of it on the card (4096) |
VICTORY_MEMORY_DUMP=<folder> |
a file go there writes the arenas out (diagnostics) |
VICTORY_UPLOAD_LOW=0, VICTORY_LENT_HEAP=0 |
lists' upload memory above 2^40, no view heap for lists without one, as before |
Every ten seconds the log has a line "title memory by address: ..." with pages, dispatches, faults and what came.
VICTORY_BVH_TRACE=1): the title asks for a new
structure's compacted size, reads it one or two frames later without looking
whether it is there, takes memory of that size and has the structure copied
into it. Our submissions land up to two frames late; the title read what the
slot held before, another structure's size, and the copy wrote over the
neighbours. Waiting for a submission that asks (VICTORY_BVH_SIZES_WAIT=1)
did not mend it and costs some 20 ms a frame (light-15): the title asks in
every frame, and what it read was as old as before. Open.VICTORY_BVH_BOUNDS). Pages touched that are not there: 2,500 a frame
before, 90 after (the dorm).CopyForBVHUpdate 13.3 ms in 63 dispatches (before the
bound), traces 24 ms (RaytraceVBuffer 7.9, screen probes 6.4, irradiance
cache 3.5, primary probes 2.3, shadows 1.6).crates/victory-gpu/src/ambient.rs)Without structures every ray misses. The title's program that resolves the
diffuse light of its screen probes (CS_ScreenProbes_TemporalResolve_*, list
184 of a frame) then leaves the sky's light outdoors, nothing indoors, and in
blocks of tiles what the probes' memory held. VICTORY_AMBIENT=<share> raises
it to an estimate right after that program: the title keeps, for its own screen
traces, the light visible surfaces send out (CS_CacheScreenSpaceRadiance,
1280x720, the frame before); its mean in 64x36 cells is gathered at 160x90
points, each cell weighted by the share of the surroundings it covers, as a
directional value; each pixel takes it between the points by depth, with its
normal and a shade in creases. So level and tint follow the hour, the room and
its lamps. What the program left counts up to four times the estimate.
Where it can be put, and the crease shade, are beloooo's (VIctory-Belobug-AMD
06031237, 4f45ab88, cd9f78ce); VICTORY_AMBIENT=constant:<level> is that
fork's constant.
| variable | does |
|---|---|
VICTORY_AMBIENT=<share> |
the estimate, 1 all of it (unset: the title's own) |
VICTORY_AMBIENT=constant:<level> |
the same light everywhere |
VICTORY_AMBIENT_SHADE=<strength>,<metres> |
the creases (1,0.6) |
VICTORY_AMBIENT_AIR=<multiple> |
what the air scatters is bounded by a multiple of the light around (off: the brown veil in the day room stays with it, light-14) |
It is off while the builder runs.
crates/victory-shader/src/bvh.rs: the reference for the node test.crates/victory-shader/src/emit/lower.rs: the lowering of the two
instructions and of memory by address (Lower::memory).crates/victory-shader/src/resource.rs: address tracking for descriptors
and raw addresses.crates/victory-gpu/src/pipeline.rs, draw.rs: the builder rule and the
host side of root views and title memory.