Remaining ProjectScarlett ray walks: RT shadow and screen-probe traces refused at the BVH header load #382
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?
Imported from brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-28T08:16:34Z.
These are the ray-walk programs that still get stand-ins on
main(cba382c), measured in two ProjectScarlett 1.0.2.1 runs to the player prompt on an RTX 4070 (GE-Proton11-14). They're the second-largest group intools/rank_pipeline_failures.pyafter driver-compile deadlines (23 of 327 stand-ins in the last run). They all fail with the same refusal:s_load at 0x…: base sN is not a root table pointer (None)In every one, the base is the console BVH's address read back from its descriptor, then a header field is loaded:
So these are the same compiler-generated inline ray walks that
scarlett_rays.rsalready lowers for four programs, not a binding problem.CS_RTShadowTrace32TemporalHQ*(_OneOver{2,4,8}RPP,FarOnly,TiledFarOnlyvariants)CS_TraceShadowRays_{Quarter,Half,Eighth,FullAdaptive,Checkerboard}CS_ScreenProbes_TraceRays_RayBinning_BVH_Shared_ShaderBinning(+WithFar)CS_ComputeClosestDepth@Jerkin42, you've been doing these walk by walk (the irradiance, sun and laser shadow lowerings). Are the RT shadow families next on your list? If not, I'm happy to take
CS_TraceShadowRays_*, so we don't both end up writing the same lowering. I'm opening this issue only so the list is in one place.(Found with Claude Code's help:
isa_windowover the requests named in the runtime cache's.reasonfiles. No title bytes are included here.)Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T06:23:50Z.
An update for this list, so the remaining piece doesn't get lost or found again. Most of these programs translate since
46a792d7(51 of the 64 that walk console structures, by its message), and its message says the runtime part that gives them the console-format copy of the scene (t0/b0space901) "is not written yet, so no walk runs in game until it is". I don't see that in an issue, so it only lives in that commit message.What we see in the game on
mainat28717263(RTX 5090, GE-Proton11-14, two runs that reach the prologue; integration build:mainplus #436, #389 and #390):0x80070057, 150x80004001, 30x80004005).t0/b0space901. They include RT shadow traces, screen-probe traces and VBuffer gathers.That isn't a problem with the translation: it's what the commit message says is missing. I haven't looked at the remaining 11, or at whether every one of these is this cause.
@brcly, is the runtime builder for that copy in progress? If not, I'd like to know before anyone starts, because it looks like the next step for RT shadows and probes.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T15:02:49Z.
With
1818969the translated walks run over empty scenes, so the question above is half answered. Before two people write the same builder: @brcly, is the part that writes the console-format structures yours, or is there a piece you would rather hand over?I can take the static bottom-level structures if that helps: the ones the title streams in packed and asks to have rehydrated (256 and more per scene). The provider already reads their headers and the geometry each entry names (
build_raytracing/rehydrate.rs), so the work is to copy the packed structure into the node buffer, fill the leaf vertices from that geometry and refit the boxes, with a check on known geometry that runs without the game. That would leave the per-frame top-level scene and the dynamic structures with you, or the other way round if you prefer.For context, on an RTX 4070 Ti SUPER (620.73.04) with an Intel CPU a run now lasts 12 min 40 s here, about ten minutes of it in the intro, once no acceleration structure is given to the host, with #389 and
fc69bc2; the picture is what you would expect from scenes with no hits (no indirect light, probe tiles). I'll post the details of that run on #232.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T15:17:37Z.
@3kynox yes please, take the static bottom-level structures. Thank you.
To answer @NickStallman's question too: nobody is writing the builder.
18189694only binds the twospace901resources with empty scenes, so the driver stops rejecting the walk pipelines (they failed to remapSRV 901:0) and they run instead of standing in. Every ray misses until real data is in that buffer. We're not working on the console-format structures ourselves. So beyond your split, the top-level scenes, the instance records and the dynamic bottom-level structures are open too, for you or anyone who wants them. Please say here before starting, so two people don't build the same piece.What the walks expect today
Bindings: a translation that walks console nodes declares raw
t0, space901, the node buffer (tb_bvh_heap), andb0, space901, the scene offsets (cbuffer tb_scenes { uint4 tb_scene_base[2]; }).iis the title'si-th acceleration structure, ordered by (space, register), as incompute_scene::SCENE_SPACE.BvhHeapinruntime/d3d12/src/device/compute_scene.rs. It's a zeroed 64 KiB upload buffer, every offset is 256, and it's bound atSceneRoot::bvh_slot(). That's the piece to replace.Layout (from the design in
46a792d7): one buffer.tools/reference/blas/shadow_instance.rs.)Node tests:
tools/shader-compiler/src/hlsl/bvh_node.rsemulatesimage_bvh_intersect_raywith the arithmetic intools/reference/bvh-node/node.hlsl.tools/reference/bvh-node/native/runs the real instruction on a gfx1036 Radeon (HSA). That's a good check that copied nodes give the same results natively and through the translation.Fields the title's walks read (inferred from their code, so treat them as leads):
4 * (node - ((h52 >> 6) - (h56 >> 2)))from the structure's base, when the short stack runs out;tools/reference/shadow-tlas/traverse.hlsl.)Your check against known geometry will show whether these hold for rehydrated data.
Already native: since #477, recognised BVH32 walks are lowered to
TraceRayInlineon the host's structures. On the recorded requests that's 9 programs entirely and 14 in part, so some of the shadow and VBuffer programs need the console data for only some of their walks, or none.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T15:49:31Z.
Thanks, and for the layout notes. I'm starting on the static bottom-level structures now. I'll say here before touching anything else (top-level scenes, instance records, dynamic structures).
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:03:01Z.
I'd like to take the top-level scenes and their instance records (not static or dynamic bottom-level structures): header, parent table, box nodes and 128-byte records from each top-level build's instance array, and the per-dispatch scene offsets in
b0, space901. The encoder is a small crate with tests, up as a draft: #525. It isn't wired in yet. @brcly, is that all right? Dynamic bottom-level structures stay open.@3kynox, so the pieces fit:
{offset in the node buffer (256-aligned), root pointer (+48), compression word (+60), object-space bounds that hold the geometry as it is now}. Instances whose structure isn't there yet are left out and counted. Does that work for your side, and who should own the buffer's allocator?bit 7 ? second triangle : none, so set means the node holds two triangles. That's the reverse of the note above, and the same astools/reference/shadow-tlas/traverse.hlsl.Points 2 to 4 are from reading the programs (point 2 from one program's data flow). Nothing here has run in the game or on a GPU.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T20:07:13Z.
@NickStallman yes, please take the top-level scenes and their instance records. Thanks for #525. That leaves the static bottom-level structures with @3kynox and the dynamic bottom-level structures open.
Thanks for the corrections. I've checked both against the reference code and fixed my note above:
tools/reference/shadow-tlas/traverse.hlsltests the second triangle only whendescriptor & 0x80is set, so set means two triangles.tools/reference/blas/shadow_instance.rs, which writes it as the bottom-level structure's own address>> 8, so it's an offset in the whole buffer, not relative to the scene. I haven't followed it through a translated program myself, so your data-flow trace is the evidence there. Node pointers stay relative to their own structure.& 0x1fffffff, and +52/+56 when the stack runs out).The buffer and the interface: one owner, in the runtime, replacing
BvhHeapinruntime/d3d12/src/device/compute_scene.rs. I'd suggest that's you, Nick, since the per-dispatch scene offsets inb0, space901come from your part. The bottom-level writer asks it for a 256-aligned offset and hands back{offset, root pointer (+48), compression word (+60), current object-space bounds}, as you listed. Instances whose structure isn't there yet are left out and counted. @3kynox, does that work for you? Please agree the interface here before either of you wires it in.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T20:08:13Z.
@NickStallman good timing. Yes to all four points, and I can confirm 2 and 3 from the game today (RTX 4070 Ti SUPER, 620.73.04, GE-Proton11-14, Intel CPU):
What I have here, not posted yet: the static structures (the packed form expanded; byte-identical to what the title's own builder library writes for 70 structures captured in a run, compared offline), one node buffer per device with its allocator, and the provider wiring: placement at the rehydration call and the per-dispatch scene offsets. To see the static structures in the game at all I also wrote a top-level writer today, so we overlap there. I'd rather not have two. If @brcly agrees: #525 stays the encoder, I put mine aside and call yours from the wiring, I own the buffer's allocator and hand you
{offset, root, compression word, bounds}per title address.Measured here, in case it saves you time:
tuxbox_dxbc::compute_table::bindingsreads them.Nothing visible to report yet. The first run with resolved scenes is going now: five minutes in the world so far with the shadow walks over real scenes, no fault.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:19:43Z.
@3kynox thanks, that's a lot further than I am, and it settles several open questions. Agreed on the split:
@brcly, if that's all right with you the allocator line in #533 moves to @3kynox.
Two things to check on #525:
write_scenebeside yours on one captured instance array and diff the walks (hits, not bytes)? Both have our own reading of the format behind them.The dynamic structures: 88% of references is a strong number, and it says they matter most for the picture. I'd like to look at them next, as a CPU encoder for geometry readable at the build call, if nobody else is on it. I'll post here before writing code.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:20:11Z.
Correction on #525, thanks to @3kynox's leaf-frame point: as first pushed it accepted any compression word and ignored it, which is wrong.
007499d7refuses any word but0x007f7f7fand leaves that structure's instances out, so for now it can't place any of your structures. Could you say how the scale and the move are encoded, or would you rather hand the encoder the leaf-frame transform? Then I'll add it, with a test on scaled leaves.Two translator notes for whoever does the offsets:
scene_sourcesmatches the same numbers, so it needs the same treatment. I traced one of the 14 programs in recent runs; its current request doesn't have it.TraceShadowRaysprograms, which are refused today. No fix from me yet.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T20:23:47Z.
@NickStallman agreed, thank you. So: the node buffer and its allocator, the static structures, the provider wiring and the per-dispatch scene offsets here; the top-level encoder in #525, called from that wiring. @brcly, if that suits you, the allocator line in #533 moves.
The leaf frame, for #525. It is the header's last word (+60) together with the header's bounds (+16):
byte << 23, so a power of two;min > 0ormax < 0), the middle of the bounds,(min + max) * 0.5, is taken off;(position - middle) * scale. The word0x007f7f7falone leaves positions as they are.The record's world-to-object rows go on into that frame, row by row:
[m0, m1, m2, m3 - middle] * scale. They are stored translation first, then the three rows. In the root word (+56) I set bit 31 only when the stored 3x3 is exactly the identity, and bit 30 when the frame is scaled; +120 is the compression word itself. The walks mask the root with0x3fffffff.{offset, root, compression word, bounds}is enough for the encoder to do all of this, and that's what the wiring will pass.Comparison. Yes. Once #525 takes scaled frames I'll build both scenes from the same instance array over the structures placed in a run, and walk both on the CPU with the same rays (hits, not bytes). My own check so far: 70 captured structures, each under one instance turned, scaled and moved at random, 11,200 rays against testing every decoded triangle in turn, no difference. That walk is a plain stack walk, so your short-stack tests cover what mine doesn't.
Your two translator notes. For the offsets I number the scenes as the translator does (every raw single-register view, by (space, register)) and find each through the program's own binding records, so the two agree whatever the root says. I'll look at #534.
First sign in the picture. With a test mode that replaces every scene by closed boxes, so that every shadow ray hits, the opening shot goes dark except for its own lights: the buildings that were lit are silhouettes. So the shadow walks' results do reach the picture here (RTX 4070 Ti SUPER;
RTDistantShadowTrace32_Tiledand its variants,TraceShadowRays_Checkerboard). One pair of captures, not a measurement. With the real static structures alone, a night scene showed no clear change.PRs. I'll open them as drafts, split: the static expansion with its tests; then the buffer, the placement and the offsets, with my own top-level writer only until #525 matches.
Dynamic structures. I'd like to take them. I already have a first writer from triangles (one triangle a leaf, 128-byte box nodes), checked offline against testing every triangle in turn, and its hook at the build call. It will be in the drafts, and it is the next thing I run in the game, since 88% of the instances wait on it. Your independent walk of what it writes would be welcome. In a short run the geometry of every build was readable on the CPU at the call (978,848 of 978,848 triangles).
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:25:22Z.
@3kynox #525 now applies the leaf frame (
32251491): rows go on into(v - t) * s, with s = 2^(e-127) from bytes 0, 1, 2 when bit 31 is set, and t = the centre of the header's bounds on each axis they don't straddle, when bit 30 is set. The identity mark is dropped when it scales; object to world and the world boxes are unchanged. A rotation (bits 29:24) is refused. That reading of the word is from Leonida'sdocs/bvh.md(written description only; the project is GPL-3.0, so no code is taken from it).Checked with made-up structures against a native ray query on llvmpipe (up to 10,000 instances, 60,000 rays a run, no hit/miss difference). The fixture uses the same reading, so it can't show the reading is right. Could you check, on your 1,340:
The interface
{offset, root, compression, bounds}stays.write_scenetakes the title's 64-byte records as the CPU reads them and returns the scene's words, the same for any position in the buffer, at mostmax_bytes(count). If you copy that bound, zero the tail: nothing beyond the words returned is initialised. An empty scene has root 0.Dynamic structures, before anyone writes a builder: a CPU encoder only works if the vertices at the build call are final. Readable isn't the same: geometry the GPU writes (skinning) would be wrong. Do your runs tell whether your 978,848 triangles were per frame, per run or distinct, and can you hash vertices at the call and again when the queue reaches the build? If not I'll write that as a log-only run. A prototype costs about 60–130 ns a triangle to build and 10–17 to refit on one core (scratch, excluding reading vertices and upload).
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:48:48Z.
@3kynox agreed, and thanks for the leaf-frame note: it matches what #525 does for scale and move. I'm checking the two details I'm not sure of against your text (bit 30 of the root word, and +120 = the compression word) and will fix them before your comparison. Please go ahead with the dynamic structures; I won't build one. @brcly, so 3kynox's line in #533 grows to dynamic structures, and the allocator line moves to them.
Two offers: an independent walk of what your writer makes, and, for the "readable at the call" question, a build that hashes sampled vertices at the call, at submission and on the GPU just before the build, since readable doesn't mean final for geometry the GPU writes. It's written and has never run; tell me if you'd like it.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:53:47Z.
@3kynox checked #525 against your details;
89f4678ffixes what differed: bit 30 of the root word was missing, bit 31 was taken from the instance instead of the stored rows, and the middle of the bounds was computed in double instead of(min + max) * 0.5in float. The rest already matched (rows, order, +120). It's ready for your comparison; it has seen no real structure yet.tb_scene_baseat all.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T21:09:50Z.
@NickStallman thanks, I'm on the dynamic structures then. Answers to your last three comments, and first a correction of mine.
Correction. I wrote "82 of them also moved". 82 is the number of distinct frame words with bit 30. The structures are 136 of the 1,340.
Bounds. Yes: what the wiring hands over is the header's own six floats at +16, as the title streamed them, before the frame.
The move. Checked against the title's own builder library on the 70 structures I captured with their geometry. The expansion takes
ton exactly the axes wheremin > 0 || max < 0, and every byte of the 70 is what the library writes (#536, draft). 13 of the 70 have bit 30: the axis that misses zero is z alone in 7, x alone in 3, y alone in 2, x and y in 1. The 57 without the bit straddle zero on all three axes, so in these 70 the bit is set exactly when an axis misses zero. Hand-built structures given to the library settle the cases the data doesn't have: bounds 1..2 with the bit clear are not moved, bounds -1..1 with the bit set are not moved, and an axis whose bounds touch zero (min == 0ormax == 0) is not moved. The other 123 moved structures of the run were expanded in the game, not compared.Bit 30 of the root word. Mine sets it whenever the structure's frame word has bit 31, without looking at the exponents (all 1,340 have it). In the public traversal source the flag is only masked off the root pointer and never tested; only the identity one is (
instanceRotationNeeded). So for that walk your choice and mine give the same hits. I have no scene built by the console to say which one its builder makes, and I haven't traced whether the title's own programs test the bit.write_scene. Fine as it stands. I'll call it with the records as read at the build call and a lookup from a structure's address to{offset, root, compression, bounds}, and zero the tail. Root 0 for an empty scene works: the walks take a root only when it is above zero as a signed number. The comparison will be on89f4678f.Dynamic structures: what my numbers are. 978,848 is a sum over the build calls of a short run (43 seconds of survey): each call's triangles, counted again every time a mesh is built again. It isn't distinct geometry. "Readable" meant only that the vertex and index addresses were title memory I could read at the call. I took no hash, so nothing I have says the vertices were final. From the 15-minute run: 2,161 bottom-level builds, 6,983,758 triangles named, so about 3,200 a build. 296 of the builds are updates with a source (flags 0x2b); the others are 0xa (1,176), 0xb (509), 0x7 (168), 0x6 (10) and 0x1 (2).
Your two offers: yes to both. The hashing build first. It hashes on the GPU just before the build, which a survey of mine would not, so I won't write my own: post the branch and I'll run it here (RTX 4070 Ti SUPER) and report the three hashes by kind of build. The independent walk as soon as the dynamic writer is in a draft.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T21:34:06Z.
@3kynox the hashing build is
diag/dynamic-blas-hash(one commit on39463ea5, not for merging). It has never run in the game, only unit tests and the shader on llvmpipe.Set
TUXBOX_DYNAMIC_BLAS=1andTUXBOX_LOG=1(orstderr, which can't cut long lines). Every 120 presents it logs a block startingdynamic structures over. Please send a few blocks from the world, whole: the two summary lines, then two lines per kind of build (flags=,differ:).It counts every bottom-level build and update. Of about 32 per present it hashes up to 16 vertices and 16 index words of the largest geometry: on the CPU at the call, on the CPU at submission, and on the GPU just before the build.
call and queue 0with manyreachedmeans the sampled words at the call were final.submission and queueabove 0 means something wrote them after submission.Limits:
probing costis the time it took on the title's threads; don't compare frame times from that run.On #525 (rebased to
0f9e873c, merges cleanly again): ours and yours agree on the axes that move, including bounds that touch zero. Bit 30 differs only when the word has bit 31 and every exponent is0x7f; I've left ours, since all 1,340 of yours have bit 31 and I can't tell which is right. Thanks for the 136 correction.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T21:58:51Z.
@3kynox
mainwas force-pushed (linear history, same contents), so I moveddiag/dynamic-blas-hashonto it: the commit is the same change, now 8d62ff9f on97f21fad. If you already have the branch, please reset to the new one (git fetch && git reset --hard). #525 is rebased too (afc09595).Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T22:29:35Z.
@NickStallman thanks for the branch. Two things before its first run here:
WINDOWlocally and say what I set it to.mainmoves very fast: the base of my runs wasmainas of this afternoon, and by tonight it was 142 commits behind. Catching up is not free here, since a new translator means preparing the shaders again (about 36 minutes) and then a first run in which the driver compiles its pipelines again (over an hour), so I can't follow every few hours and my numbers lag yours. My work is now ported onto97f21fadwith your commit on top (it applies without a conflict; 537 of the provider's unit tests pass here, and the same two fail as on baremainin this environment: thescene_publicationones, which need a hardware device my check prefix doesn't have). The shader preparation for that base is running now; your blocks will follow the first runs on it, not come tonight.An offline check of what the writers produce, meanwhile. In a 7-minute run I dumped the node buffer right after the scenes of the first frame in the world: 127 MB, the main scene with 3,057 of the title's 3,058 instances, 367 of them over rehydrated structures and 2,690 over structures built at run time. Then I walked that buffer on the CPU, outside the game, with my test walk (the one written from the public traversal source):
So for that first frame the geometry read on the CPU at the build call was the real one for those four buildings. It says nothing about skinned meshes, which is what your hashes are for, nor about the title's translated walks on the GPU.
Three of the pictures: from the air, from the street, and from above with what comes from rehydrated structures in blue and from built ones in orange.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T22:57:51Z.
@NickStallman the comparison I promised, on real scenes: #525 (
afc09595) and my writer give the same hits.What was compared. The dump from my last comment: the node buffer after the first frame in the world, with the five scenes my writer had placed. For each scene I read the instances back from my records (object-to-world rows, ID and mask, contribution and flags, place in the title's array) and the structure each one names (its header's root, bounds and compression word), gave them to
write_sceneat the title's indices, put the result in the same buffer, and walked both scenes on the CPU with the same rays.No ray hits in one scene and misses in the other, and none hits at another distance. The 233 rays of the "another triangle" column hit two triangles at the same distance, and each tree names one of them. I haven't looked at which they are; a shared edge or doubled geometry would do it.
Record against record, by the place in the title's array: all 4,048 records hold the same transform words bit for bit (object to world, and world to the leaves' frame), the same root pointer, page and compression word, and the same two marks. The marks agree because every structure here either has a scale (the rehydrated ones) or the plain word (the built ones); the case where we differ, bit 31 with every exponent at
0x7f, doesn't occur in this data.Your scenes are a little smaller than mine (577,024 bytes against 601,472 for the main one).
One thing this does not cover: the instances come from my records, so only the ones my writer kept were given to yours. It had left two out as instances no ray could enter (one in the main scene, one in the fourth); the title's own records for those two are not in this dump, so I can't say what
write_scenemakes of them.Limits: the walk is my test walk, a plain stack walk, so it says nothing about the short stack or the parent table of either scene; and the rays are random (half from anywhere in the scene's box, half from within 40 units of an instance), 4.4 million in all.
So I'll call
write_scenefrom the wiring and put my own writer aside, as agreed. The comparison tool is local (it reads a dump of the title's data); I can post its source if you want to run it on a dump of your own.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T22:58:54Z.
@3kynox thanks for the offline check, that's a lovely result.
diag/dynamic-blas-hashis now d275f107 (on your97f21fad, one commit more): a block closes after 20 s, 2,000 builds or 120 presents, whichever is first, also in the middle of a frame;TUXBOX_DYNAMIC_BLAS_SECONDS,_BUILDSand_PRESENTSchange that (0 = no such limit).diag/dynamic-blas-hash-mainis the same onf360038d.About 32 builds a frame are hashed, so please send as many blocks as the run gives;
reachedtrailshashedat slow frames. Still never run here in the game.A caution about a newer base: on our machine plain
main(6bab5478and back to at least #530) crashes the title at start-up, and I'm bisecting which commit. Your97f21fadis later than #530, so you may hit it too; I'll say on the tracking issue when I know.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T23:02:47Z.
@NickStallman the start-up crash is #554: it is bisected there to the acphal change of #527 (
55a6f4fd), with the backtrace I get too (VCRUNTIME140.dll + 0x1989called fromgame_scarlett_master.exe + 0x43AED60, crash reportGame State: Game Init, frame 0). I hit it on97f21fadin 2 runs of 2 (RTX 4070 Ti SUPER), 110 s and 32 s after launch. I've restarted with every provider of that base exceptAcpHal.dll, which is now the one built before #527, and I'll say on #554 whether that gets through init here.Thanks for d275f10. Tonight's runs were already queued on 8d62ff9f plus a close after 60 seconds that I had added locally, so the first blocks will come from that; I'll move to d275f10 for the next ones. The runs, one change at a time: cold cache, warm reference, the same without my skip of the host builds, then the probe.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T23:17:11Z.
@3kynox the start-up crash on
mainis #527's (the audio heap), in #556, with a draft fix in #557. Your97f21fadhas it. If your run dies in the first two minutes with an access violation ingame_scarlett_master.exe+0x43AED60, that's it.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T23:21:22Z.
@3kynox thank you, that's far more than I hoped for, and a much better test than mine. I've put it in #525's description with its limits. For what it doesn't cover: my unit tests walk with stacks of 64, 8 and 3 entries, so the parent table gets exercised there, on made-up scenes. The two instances your writer left out I can't judge without the title's records for them;
write_sceneleaves out instances with mask 0, no structure address, or a NaN in the first matrix element (counted inactive); ones whose structure the lookup doesn't know (missing); and ones it can't express (refused): a non-finite or singular matrix, a turned leaf frame, or invalid bounds. A flattened instance (determinant 0) is in the last group.You were right about the start-up crash: it's #554, and I've posted there which allocation fails.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T02:48:10Z.
@NickStallman no block with a build in it yet. Here is why.
The first probe run was my mistake. I set
TUXBOX_LOG=stderr, which nothing captures under my launcher, and my menu key presses are driven by the log, so the run sat at the profile menu for its 16 minutes. Nothing usable.On main's own path the title dies as the world comes up, in 3 runs of 3. Base:
97f21fadwith my local console-structure changes and theAcpHal.dllfrom before #527, none of my switches set, RTX 4070 Ti SUPER. Two of the three had the probe (8d62ff9f plus my 60-second close). Exit code 5 after 532, 517 and 555 s, each time an access violation on a title thread with the same stack:Up to that point every probe block reads
0 builds (at most 0), 0 updates (at most 0), 0 triangles (at most 0)(83 blocks in one run, 81 in the other): the title builds nothing dynamic before it dies.The provider's log has the same sequence before the crash in all three runs: 10 to 13 lines
recorded inline compute shader … dispatch with scene GPU VA … through a reflected table, then a stall (GPU worker fence stalled worker=texture_readback …, 8 timesGPU memory wait released after 5s without reaching its target, 22stalled label …lines), then the access violation. I haven't isolated the cause. I also haven't run a bare main, so I can't say my local changes play no part.The runs that go on can't feed the probe. With the structure builds refused (my
TUXBOX_SKIP_ACCELERATION_STRUCTURESswitch) the same build spends 8 to 30 minutes in the world, but a refused build never reaches the probe's hook.So I can't give you blocks from this base as it stands. I can look at calling the probe for refused builds too, so that it counts and hashes in the runs that survive, if that would still tell you what you need. Otherwise the blocks wait until the crash above is understood.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T02:49:29Z.
@3kynox I think that's the crash we're chasing: same three frames,
+0x23CF683,+0x2215C35,+0x2215ECA, on an RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-14), after the same stall, with exit code 5 (78b, 79a, 79c, 80a, 81a, all five of our runs that got as far as the story). It doesn't need your local changes: our builds are mainf482572aplus our PRs.What you can check: does your provider log have
inline ray scene or geometry changed after recording, rejecting submissionjust before the stall? Ours does, every time. A rejected list drops everything after it on the direct queue, so the labels it was to write never land.Cause, measured: a list captures the scene, then a later list rebuilds that scene larger at the same guest address.
guest_memory::targetfinds the storage too small and gives the rebuild a new one, so the list recorded first holds an address the scene no longer has. Submitted after the rebuild, it's refused (81a's trace, in order: captured, rebuild recorded, old list's neighbours passed, rebuild submitted, refused). On a console it would just read the rebuilt scene at the same address.Fix, not a PR yet:
d3d12/scene-stable-storage(fa287c8eonf482572a). A top-level build in title memory gets room for 4 times its instances (at least 2,048), so a grown rebuild stays put. A device test that captures, rebuilds 2,000 instances and traces fails without it and passes with it on both our cards. It hasn't run in the game yet; that's queued for today. A scene that outgrows even that is still moved and refused, as now.It touches
guest_memory::target(new parameter),blas::build_destination,blas::replacement_destination,blas::targetandbuild_raytracing::translate. If your #382 wiring hooks those, please say so here before I open it; I don't want to collide. A second branch adds tracing:diag/scene-stable-trace(f55756a6), log only.On the probe: calling it for refused builds would still be useful to me if it's cheap, but first try this branch in place of your refusal switch, if it applies on your base. If the crash goes away, your blocks with real builds may too.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T03:09:57Z.
@3kynox first game run with it (RTX 5090, an integration build of
f482572awithd3d12/scene-stable-storage, one run): no refusal and no stalled label, where the five runs before it all ended on one within two or three minutes of story loading starting (before the world). It drew the world and then lost the GPU (Xid 13, an MMU fault in a shader, about a minute into the world). I'm now tracing that; it's the same kind of loss we had in an older run, so I don't read it as caused by this branch, but one run doesn't show it isn't. No "outgrew its storage" line appeared.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T05:20:06Z.
@NickStallman three things: your branch on my base, the blocks, and a correction to what I said about the geometry.
The line you asked about. Yes:
inline ray scene or geometry changed after recording, rejecting submissionis in each of my three crashed runs, once, before the stall.#566 on my base. I applied it over
97f21fadwith my local changes (three conflicts, all in lines I don't touch, your side taken) and ran main's own path with none of my switches and your probe (8d62ff9f plus my 60-second close). One run of 20 minutes, RTX 4070 Ti SUPER: no rejection, no stalled label, no crash. It ended on my time limit about 11 minutes into the story, with no GPU loss. One run, so not a rate. The device test #566 adds fails here under Wine like the two beside it, for want of a hardware device.My wiring doesn't touch
guest_memory::target,blas::build_destination,blas::replacement_destination,blas::targetorbuild_raytracing::translate. It hooksrecord_buildsand the batch entry, and adds accessors next toblas::guest.The blocks. 11 of the 102 blocks have builds, all from the story. They are whole below. Summing their
call and queuelines: the vertices differ in 188 of 191 hashed builds and 1,683 of 2,092 hashed updates of format 6 with index format 53, in 84 of 246 builds of format 6 with index format 57, and in none of the 599 builds of format 16 or the 198 updates of format 6 with index format 57.11 blocks, in order
Correction. I wrote here that the geometry of every build was readable on the CPU at the call (978,848 of 978,848 triangles). Readable, yes. Right, no, and your blocks say so better than I can. On my side it showed like this: in a dump of my buffer taken in the first cutscene, 5 of 3,242 instances pointed at structures I had written from those bytes with corners up to 2.4e38. Four of them stand in a row 5 units apart, which I take to be the characters. The words read (
0xa0f4f36e,0xa0f4f571,0xa0f0f576, ...) are not floats. One such structure is enough for every ray of a walk to end on it: against the scene #525 writes from the same records, 21,620 of 2,000,000 rays ended at another distance.I now refuse a structure with a corner beyond 100 km and leave its instances out. The same comparison then gives no ray at another distance (4.4 million rays over five scenes), and more than 500 builds were refused in a 21-minute run. That is a guard, not an answer: those meshes need their positions from what the GPU wrote.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T05:49:51Z.
@3kynox thank you, that's the confirmation I hoped for, and on a different card: three crashed runs with the same line, and a clean 20 minutes with #566 on your base. I've added it to #566 (with your caveat that one run isn't a rate), and good to know your wiring doesn't touch those functions. Your blocks are a lot of data; I'll read them against your dynamic structures work and answer separately. If you get more runs with #566, even a failed one is useful.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T09:26:53Z.
@NickStallman one more run with #566, on the new base, as you asked. Build:
e5d2e913with53c0c6bacherry-picked, plus my three BVH commits, which do nothing without their switch. RTX 4070 Ti SUPER, 620.73.04, GE-Proton11-14.Without my switch: 25 minutes, to my time limit, about 16 of them in the world. No
rejecting submissionline, nostalled label, noGPU memory wait released, no crash, no GPU loss, no Xid. It has 12GPU worker fence stalled worker=texture_readbacklines; last night's clean run had 17. So here two runs of two with #566 go on, 20 and 25 minutes, against three crashes of three without it.With my console structures switched on, same build: three runs, three GPU losses (Xid 13 each time), 1 to 4.5 minutes into the world, none with a rejection line:
CS fb8e97e0andCS 503c6dad;a902033a,bd054a51,65f82768,3b375136): 19 unfinished, all mesh-shader draws,PS d31892ba MS c8ab57f2,PS 82ebe1a5 MS a4b9766d,PS b5b8081c MS 2b2fbcf0,PS 11d2ca67 MS a6c5b3d3, then the title's access violation at+0x2215ECA;VS 8b6223a0 PS 0a3fd624andVS de066709 PS 881f4d5c.Three of three against none of one is too few runs to say my wiring causes them, and two of the three are in draws, as in #232. The first is the second time of two that giving every walk the buffer loses the GPU in a walk of the light-probe passes (
CS 46e83e55the other time); I have not found which read faults. I'm running more before the wiring goes up. The rebase of #536 is ready and goes up next, then the buffer.Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-30T15:50:40Z.
@3kynox @NickStallman an AMD data point for the
fb8e97e0/503c6dadpair, without any console-structure switch: plainmain8345699c(#566 in), RX 9060 XT (1002:7590, RADV, Mesa 26.3.1), GE-Proton11-14,TUXBOX_XMEM_PRIVATE_VIEWS=1, one run.rejecting submissionline this time. My two runs before it, onf482572a, both ended on that refusal at game time 3:00.[gfxhub]page fault from TCP (a read,MAPPING_ERROR 0x1) on seven host pages,0x8001ed3f4000to0x8001ed3fd000. The fault trace had two commands unfinished: dispatches ofCS fb8e97e0andCS 503c6dad, the same pair as in your loss with every walk given the buffer.video memory is nearly full: placed texture #1024 put in system memory (164 MiB so far), card 12,870 of 14,152 MiB in the last ledger). That's the same fault shape @TheLore64 just reported on #232 for an RX 9070 under VRAM pressure, there inVS 281b4977/PS 96e8aaaa.So on RADV this pair faults with the switch off too, though here the pressure may be what makes it fault rather than the walk itself; @Jerkin42 skips the inline ray-query programs on the same card for the same fault (#472). I haven't looked at which address
fb8e97e0reads. If it helps, I can rerun withRADV_DEBUG=bo_historyto see whether those pages were ever a buffer.Edit: corrected the Mesa version.