d3d12: keep console-format structures for the ray walks in one buffer #586
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/586"
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 3kynox on 2026-11-30T10:37:58Z.
Summary
For #382, the second of the pieces agreed there: the buffer the console-format structures live in, and the bookkeeping of its places. It follows #536 (the expansion of the packed bottom-level structures) and is independent of it: the two can be reviewed and merged in either order.
A translated ray walk reads every scene from one raw buffer and takes each scene's place in it from a block of offsets. Today that buffer is the empty one
compute_scenemakes for each walk.device::console_heapis the real one, one per device:Review fixes,
351fbb4a(the three remarks of the automatic review):queue_trace::pending_fences), and a place given up at present N is free once every batch submitted by present N + 4 has run;Not covered, and the module comment says so: a list recorded before a place is given up and handed to its queue more than four presents later. Only the list could hold what it binds, which belongs with the wiring.
Nothing calls it yet, so behaviour does not change. The file is marked
allow(dead_code)until the wiring PR, which removes the marker.Why the places are reused at all: a first version only ever took new places. ProjectScarlett builds its scenes again every frame, and in a local build that also wrote the structures the title builds while it runs (an experiment, not in these PRs) a 1,920 MiB buffer was full after about five minutes of the world; after that the walks read nothing new. With the reuse here, the same load held about 1,080 MiB after 16 minutes (one run, RTX 4070 Ti SUPER, before the rebase onto current main; the bookkeeping code is unchanged since). Both numbers are from that experiment, which writes hundreds of structures a frame. With what these PRs write (the rehydrated structures and the scenes), the buffer holds 84 to 126 MiB when the world starts and 140 to 223 MiB ten minutes later: it grows with the number of structures the title loads, not with the scenes written again every frame (the comment of 2026-11-30 has the runs).
TUXBOX_CONSOLE_HEAP_MB(1 to 4096, default 1024) sizes the buffer, and is indocs/ENVIRONMENT.md. A walk's offsets are 32 bits, so the buffer never passes 4 GiB.Tested
Run the checks relevant to this change.
mainon this machine (below)No Lanes scenario: nothing calls the buffer yet. The part that needs no device (the places, the clock they rest by, and what is named or held by what) has eighteen unit tests, among them a buffer written again every frame for 150 presents, ten times its size in all, that must not fill, and a place that waits for a GPU twenty frames behind. 32 errors planted one at a time (a place freed at once or never, free places not joined, the first fit taken instead of the smallest, a name counted twice, a scene that holds none of its structures or keeps holding them, a clock past a present that still waits and so on) each fail at least one test. The part that makes and maps the upload buffer has no test here; it ran in the game (below).
In the game, before the review fixes, with #536, the wiring and #566 on top: two 9-minute runs made the buffer (1,024 MiB), placed 256 and 485 structures by their last counts and 5 and 10 scenes in it (58 MiB held at most), and bound it to the walks. Both ended on a GPU loss a minute into the world, one in a walk given the buffer and one in mesh-shader draws; a run without the switch went 25 minutes. I can't tell yet whether the two are related; more runs come before the wiring PR does.
Before the rebase, from a local build that also has the wiring: a dump of the buffer taken in the world was walked on the CPU, 4,399,968 rays through the scenes it held. No ray failed to read what it followed, and none ended at another distance than in a scene written anew from the same records by #525's encoder: at that instant no place still in use had been written over.
GPU, driver and backend: none needed for the checks below. The game runs: GeForce RTX 4070 Ti SUPER, 620.73.04, GE-Proton11-14, Core i9-12900K, ProjectScarlett 1.0.2.1 offline.
The
Evidence:linetuxbox.py checkprints last, one per card (it names the commit it tested; run it on this pull request's head):Everything below was run on the head commit,
351fbb4a. The review fixes have not run in the game yet.Commands run and their results:
Checks
CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, a Windows typecheck of every crate, and clippy.
Imported from brcly/TuxBox. Originally posted by Copilot on 2026-11-30T11:21:16Z.
Code review location:
runtime/d3d12/src/device/console_heap.rs; line 122A recorded list can be submitted or replayed after four presents, and another queue can still be reading when this counter expires. Reusing the placement then overwrites the scene or offsets those commands address; retaining the buffer in
binddoes not preserve its contents. Retain placements for recorded bindings and allow reuse only after those references are released and all consuming queues complete, usingdevice/blas/lifetime.rsas a model for fence tracking.Imported from brcly/TuxBox. Originally posted by Copilot on 2026-11-30T11:21:16Z.
Code review location:
runtime/d3d12/src/device/console_heap.rs; line 287Replacing a structure's last address name queues its placement for reuse even if a live scene still embeds that offset (
runtime/bvh-layout/src/scene.rs:147). After four presents, another allocation can overwrite it whilescene_atstill returns the unchanged scene, so a later walk reads unrelated geometry. Track each scene's bottom-level placement references and release them only when the scene and its readers retire.Imported from brcly/TuxBox. Originally posted by Copilot on 2026-11-30T11:21:17Z.
Code review location:
runtime/d3d12/src/device/console_heap.rs; line 375If a rebuild cannot fit, this return leaves the previous structure mapped at every address in
addresses. A laterplaced(address)therefore returns the old header and offset and lets a new scene use stale geometry, instead of treating the failed structure as absent as the module contract specifies. Please forget the supplied address names on allocation failure, just asscenedrops its previous mapping when its replacement cannot be written.Imported from brcly/TuxBox. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-30T11:21:17Z.
Review: COMMENTED
🟡 Changes recommended
Placement reuse can overwrite geometry still referenced by recorded commands or live scenes before all readers retire, and failed rebuilds leave stale address mappings accessible.
3 open issues
What changed in this PR
Adds shared-buffer storage and address bookkeeping for the console-format structures used by translated ray walks (#382). The module is not yet wired into builds or dispatches, so runtime behavior remains unchanged.
Changes:
runtime/d3d12/src/tests/device/console_heap.rsruntime/d3d12/src/device/console_heap.rsruntime/d3d12/src/device.rsdocs/ENVIRONMENT.mdTUXBOX_CONSOLE_HEAP_MBand its current unwired status.Review effort: Balanced
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T11:46:00Z.
Thanks. The reuse with a four-present rest, the smallest-fit choice, and the 18 planted errors each caught by a test all look right.
I'm holding this together with #536 until the wiring PR is up (reasons there): nothing calls it yet, and the switched-on runs on #382 end in GPU losses. Two things to have answered by then:
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T12:26:05Z.
Code review location:
runtime/d3d12/src/device/console_heap.rs; line 122Agreed that four presents counted on the CPU say nothing of how far behind the GPU is. In
351fbb4athe places rest by a clock that follows the GPU. At each present it notes what the queues still have to run (queue_trace::pending_fences, whichblas/lifetime.rsreads at retirement), and a place given up at present N is free only once every batch submitted by present N + 4 has run (a queue's mark moves after each batch,submit.rs). A GPU twenty frames behind keeps the place twenty frames longer (a_place_given_up_waits_for_a_gpu_that_is_frames_behind).What this does not cover, and the module comment now says so: a list recorded before the place was given up and handed to its queue more than four presents later. Only the list itself could hold what it binds. That belongs with the wiring PR, where
bindis called at a dispatch and the list is at hand; I would rather do it there than guess the list's side from here.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T12:26:07Z.
Code review location:
runtime/d3d12/src/device/console_heap.rs; line 287Right. A scene now holds the place of every structure its instance records name:
scenetakes those places, and a structure's place is given up only when no address names it and no scene still seen holds it. It then rests from the same present as the scene's own old place, so the two cannot be written over in the wrong order. A scene that names a place given up since the caller read it is not placed at all. Tests:a_scene_holds_the_places_of_the_structures_it_namesanda_structure_two_scenes_name_keeps_its_place_until_both_let_go.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T12:26:09Z.
Code review location:
runtime/d3d12/src/device/console_heap.rs; line 375Right, and the early return on a short header had the same hole.
Book::structurenow forgets every address it was given when the structure finds no place, soplacedanswers none for them, as the module comment promises (a_structure_that_finds_no_place_is_no_longer_seen_at_its_addresses).Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-30T17:59:17Z.
Heads-up for
@3kynoxand@brcly: on an RX 6900 XT (main87298944+#389/#589/#590), twoRADV_DEBUG=hangcaptures hit a 100%-reproducibleTCPGPUVM read fault in console ray-walk compute shader571d96cad08597a9.dxil(DISPATCH_INDIRECT) wherepointer_words(tools/shader-compiler/src/hlsl/emitter/scalar_memory.rs) andbvh_node::emit(tools/shader-compiler/src/hlsl/bvh_node.rs) issuetb_bvh_heap.Load/Load4unconditionally on inactive lanes whose address VGPR still holds stale float bits (e.g.0xbc07e000), reading ~3 GiB past thetb_bvh_heaproot SRV;tb_bvh_intersectalso fetchesnodes.Load4before checking invalidtypesentinels (2/3/6/7, e.g.0xffffffff). This may explain the GPU loss "in a walk given the buffer" seen in your game runs—I've claimed thexshaderfix for those inactive-lane/invalid-pointer loads on #533.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T19:22:21Z.
Answers to the two questions, and where the runs stand. All on ProjectScarlett 1.0.2.1 offline, RTX 4070 Ti SUPER 16 GB, 620.73.04, GE-Proton11-14:
a2650681with #536, #586 and the wiring, and #389 ported on top except where I say otherwise.1. The slow growth. The 1,080 MiB came from a local build that also wrote the structures the title builds every frame, which none of these PRs do. That number should not stand next to this PR and I'll reword the description. With what the PRs do (rehydrated structures and the scenes), the buffer holds 84 to 126 MiB when the world starts (920 to 1,016 structures) and 140 to 223 MiB five to ten minutes later (about 1,700 structures). The bytes held per structure stay the same within a run (0.12 then 0.13 MiB in one, 0.09 then 0.08 in another) while some 500 scenes are written again, so the scenes do not add to it and the reuse does what it is for. What grows is the number of structures: a place is given back when the title rehydrates or builds at the same address again, and nothing tells the provider that the title has dropped a structure. So it does not level off while the opening streams the world in: 8 to 16 MiB a minute. Two ways to bound it, neither done: give up what a new structure overlaps in title memory, or give up a structure no scene has named for a while and expand it again when one does. I want to measure which structures stay unnamed before choosing.
2. The default size. It can grow on demand, because a scene's offsets are relative to the buffer: a larger buffer that begins with a copy of the smaller one reads the same to a walk. I have that written and not pushed: 64 MiB at first, twice the size when nothing fits,
TUXBOX_CONSOLE_HEAP_MBas the most it may be; two more tests, 39 planted errors of 39 caught, Miri clean. One run in the game made the three buffers (64, 128, 256 MiB in the first twenty seconds of the world) and went on placing, 1,007 structures and 119 MiB with two walks bound; I have not walked a dump taken after a growth. It is not pushed because of one gap: the wiring binds the buffer's address into the list and does not make the list hold the buffer, so a list that waits longer than the rest would read an address that is gone, where today it reads old bytes. I'll close that first.What the size costs on this card, measured: the title fills video memory by itself (the card sits at 15.3 of 16 GiB in a run without the switch, desktop included) and vkd3d-proton puts UPLOAD heaps in host-visible video memory. The 1,024 MiB buffer never fit: in five runs of five, "Memory allocation failed, falling back to system memory" is the line just before the buffer's own. A 320 MiB one was made without that line, and 208 allocations fell back after it; the 35-minute run without the switch had one in all. So reserved whole it lands in system memory here, and smaller it takes video memory from the title. I do not know which of the two this buffer should be on a card this full, and would like your view.
The runs. With
TUXBOX_CONSOLE_STRUCTURES=1and #389, six runs of seven lost the GPU (Xid 13): 2.4, 7.9, 8.7, 9.0, 15.5 and 19.1 minutes after the first structures. The seventh reached its 25-minute limit; it is the only one made with a local switch that keeps the host from building any structure, and I do not read much into one run. Without the structures, two runs went to their limit: 25 minutes before #389 was ported, 35 minutes after. In frames presented in the world: 6 losses in 913 with the switch, none in 631 without. No setting I tried holds: four walks given the buffer, two, none; a buffer of 1,024 MiB, 320, 1, or growing.VS 281b4977/PS 96e8aaaa(the run without #389, 3.2 minutes) andMS 4db9a403withMS 84798173(two runs). The programs of the other four are not in #232.So on this card the switch brings a loss that the two runs without it did not show in an hour, through something other than the walks' reads: what is left is the work on the CPU at each rehydration and scene build, and the buffer's allocation. I have not told those apart, and with losses anywhere between 2 and 19 minutes one more run says little.
DrArroway, thank you for the capture. Loads on inactive lanes would fit the loss we had earlier with a walk's dispatch in flight, and a read 3 GiB past a root SRV lands on whatever else is mapped, which this buffer changes. #594 is in since; the next runs are on main with it, and I'll report here.
Visible effect. None I can show. The opening is a cinematic that advances with the frames presented, one every five seconds here, so two runs do not show the same shot at the same moment. In the one static shot I can compare, the picture with two walks bound is the picture without. About 2,050 of the 3,250 instances of the main scene name structures the title builds while it runs, which these PRs do not write.
Neither of your two conditions is met, then. The wiring PR is up as a draft, #596, on current main and stacked on these two, so the three can be read side by side. Everything above was run on
a2650681, before #594 and #595.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T20:41:24Z.
A correction to what I wrote above about #389, and three runs on tonight's main.
#389. I wrote that it does not separate anything here. That holds for how long a run lasts, not for where it ends. Without #389, both losses have only
VS 281b4977/PS 96e8aaaain flight: 3.2 minutes after the first structures ona2650681, and 36 seconds on0b889d74with this stack, which is #596 as it stands. With #389, none of the five losses whose list of commands in flight is complete has those draws (two more lists were cut at 48). Small numbers, but it does take one fault away, and #596 will not hold here without it.The 36-second run had
VKD3D_CONFIG=fault:ReadInvalidat0x48140000, offset 0 of a 64 KiB range (VkBuffer [global-buffer]) bound two seconds before the report, with no unbind in its history. vkd3d-proton says the address "is currently mapped" and "should not normally page fault".On
0b889d74with #389, one run each, so read them as such:dispatch CS 1a703579.TUXBOX_SKIP_SHADERS=1a703579: no device loss; the title's own crash handler ran 2.4 minutes after the first structures.ReadInvalidat0xdc01afa000in a range that images were bound to and unbound from twice before.So tonight's main does not hold on this card without the structures either, where
a2650681went 25 and 35 minutes, and I cannot measure the switch against it yet. I'll put the last report on #232 if it is of use there.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-01T10:48:25Z.
Runs on main
717a74c4, as promised above. ProjectScarlett 1.0.2.1 offline, RTX 4070 Ti SUPER 16 GB, 620.73.04, GE-Proton11-14 (kept so that the caches stay; main pins 11-15). The stack is #596 rebased on main, which applies cleanly, plus a local commit that also writes the structures the title builds from packed positions. One run per line; the time is counted from the first ray dispatch of the world.Main does not hold here with or without the switch, and the switch does not shorten it.
PS fd6b23dd MS e0a84bdc), then 109PS 8c407793 MS 4db9a403, 20 draws), then 109PS 1b5fcea8 MS b91b86fc, 24 draws), then 109PS 8f67a984 MS a4b9766d, 10 draws), then 109PS c040ab25 MS 0e904b85, 6 draws), then 109PS 8da78bbb MS baf207f9, 20 draws), then 109In all six,
video memory is nearly fullbegins before the world or within a minute of it, and frames then take seconds (61 frames in the last 536 s of the 558-second run). That is the timeline @brcly gave on #533 for this card. So the first condition cannot be measured against main for now. What these six runs say is only that the switch does not bring the loss forward.No dispatch is in flight at any of these six losses, only draws. Yesterday's 39-second loss on
0b889d74had one command in flight, the dispatch of request13757b64…(CS 1a703579there). Main emits that program differently: several structured loops where0b889d74emitted one loop that dispatches on a program counter.The walks for indirect light and reflections cannot be given the buffer yet. With every walk given it, the device is lost as soon as the walks are bound (one run, on
0b889d74with #389; not tried on main): Xid 109, no fault address, one command in flight,dispatch CS d2a8237e(requeste2e6f99b…). That program reads neither the node buffer nor a ray query. It is the one that consumes the hits: 26 loops over heap indices, each under the translator's 65,536 guard, loading throughResourceDescriptorHeap. Its HLSL is the same on main. I have not looked further; until it holds I leave those five walks on their empty buffers. Two of the five are null passes in any case: main's translator refuses requestsfb8e97e0…andee98fc5f…with "raw buffer IDXEN needs the console descriptor stride".Visible effect: none seen from the four distant-shadow walks in the yard scene of the intro. The runs without the switch die before the shots worth comparing, so the 1,201-second run alternates instead: a local switch gives the walks the buffer for 45 s, then their empty buffers for 45 s, and the log dates each change. In the yard shots I compared eight pairs of captures taken 30 to 60 s apart, one with and one without, at a quarter of their size and with the camera drifting. Seven show the same picture; in the eighth the yard's geometry is missing from one capture altogether. As a control I ran the same alternation with closed boxes around each scene in place of its structures, so that every ray hits (661 s of the world, 172 frames, the same end): the two pairs taken within one shot show the same picture too. On an older base (
97f21fad, November 30) those boxes turned a sunset shot bright yellow. So in this scene what these walks return does not reach the picture, whatever they are given. I do not know yet whether that is the scene or something that changed since.The structures the title builds. Not in #596; this is the local commit, and where I am going next. Builds in packed positions are written from title memory at the call. In the 1,201-second run, builds in float positions are written at the call too, then read again once the GPU is past that frame: this host's profile says
section-import=aliased, so the CPU then sees what the GPU wrote. Of 8,192 such builds read again, 5,777 were written at the second reading, either because their bytes had changed or because the call had found bytes that are not positions and written nothing; 946 could not be read then either. The main scene then holds 2,550 to 2,590 of about 3,250 instances, against 765 to 779 of about 2,700 with packed positions only (the 558-second run). I have not checked those structures against a reference, and a host that substitutes the import would see no change at the second reading. The buffer held 999 MiB of its 1,024 after those 20 minutes: nothing bounds it yet, so the growth you asked about comes first.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T11:04:26Z.
@3kynox one candidate for the Xid 13 in mesh-shader draws, not tested against your fault: on main the mesh and amplification stages of a mapped-root pipeline are translated without the index map, so under descriptor paging they read other descriptors. #617 (draft) fixes that; its Lanes scenario fails on main and passes with the change. If you try it on your card, the pipelines in your loss lines would be the ones to watch.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-01T12:38:47Z.
@NickStallman thank you. Tried on this card: main
717a74c4with #617 applied, same setup as above, one run per line, time counted from the first ray dispatch of the world.PS 8f67a984 MS a4b9766d(25 draws) in flightPS b56093d0 MS 7b9b4f4e(16 draws),PS 9d0710ae MS 9e6ae248(9)Without #617 the two runs with the switch off lost the device after 158 s and 13 s, so it looks like the fix for those here. One run, but it is the first on today's main to reach its limit on this card.
With #617 the switch brings a loss the run without it no longer has, which this morning's runs could not show since both sides died.
VKD3D_CONFIG=faultgivesReadInvalidat0x10602e000and0x10a565000. In both the nearest bound range ends at0x100000000(2 MiB and 4 MiB long), so the reads land 96 and 165 MiB past it. I do not know yet what in the switch does this; it is what I look at next, and #596 stays a draft until I do.The indirect-light walks, to complete the paragraph above. Six runs of six with every walk given the buffer end about 15 s after the walks are bound: Xid 109, one command in flight, each time a hit-resolve program dispatched through
ExecuteIndirect(requestse2e6f99b…,4bada859…,b09437b6…, two runs each; five of the six on main). Reading the argument buffers back from title memory when the device is lost: the program of request1859cab3…asks for 95,048 and then 100,976 groups in X, over the 65,535 a host dispatch takes in one dimension. Main splits a direct dispatch that large; nothing does for an indirect one. The resolve program in flight reads (0, 0, 1) by then, which need not be what the GPU read when it started. The title's signature for these dispatches is type 105 with a stride of 12 and a flags word of 0.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T12:49:31Z.
@3kynox thanks for trying it. I have added your run to #617. For comparison: our builds have carried that change all evening, and we still see intermittent device losses on the first world scene change, 125-200 s in, on a 32 GB card: Xid 109 with mesh draws or compute (shadow rays, culling) in flight, and twice Xid 13. It is a different program each time, and runs with extra diagnostics on fail far more often than plain runs. We are still narrowing it down and will post when it is measured.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-01T13:39:48Z.
Narrowing what in the switch brings the loss back with #617. Same setup as above, one run per value, time from the first ray dispatch of the world.
It is not the CPU work at each rehydration and scene build: the 1 MiB run does all of it (1,703 structures expanded, nearly all left out for lack of room) and reaches its limit. It is not the walks' reads either: the run with no walk given the buffer is lost too. It follows the size of the buffer. The 1,024 MiB one falls back to system memory when it is created, in every run; the 256 MiB one does not and lasts longer.
Every loss has only mesh-shader draws in flight, and
VKD3D_CONFIG=faultreports aReadInvalidin memory that was never mapped, 29 to 177 MiB past a range of 2 or 4 MiB. On a card the title already fills, that reads as memory pressure rather than as anything in the buffer, which is @brcly's second question on this PR. One run per line, and @NickStallman's intermittent loss falls in the same window, so the two short runs prove little by themselves; the two that reach the limit and the order of the others are what I go by.The buffer that starts at 64 MiB and doubles when nothing fits is merged locally on top of #596 (two more tests). I'll push it here once it has run in the game.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-01T14:40:44Z.
Two runs with the buffer starting at 64 MiB and doubling when nothing fits (local, on top of #596 and #617), four distant-shadow walks given the buffer, same setup and same clock as above.
ReadInvalidin a 0.7 MiB range that had been bound and unbound before; 31 dispatches of the title's skinning programs in flight (requests00fed6ad…,c026151c…,5d56eda2…), no drawReadInvalidin a 192 KiB range bound and unbound before, 140 draws in flightIn both the buffer went 64, 128, 256 MiB, with 990 and 1,507 structures placed, none left out and no fall back to system memory. Neither fault is in memory that was never mapped, which every loss with the fixed-size buffers was; both are the freed-then-read kind, far from the buffer.
So with #617 and the buffer starting small, the walks read the structures for 20.8 minutes of the world in one run of two, and the other ended on what looks like the intermittent loss @NickStallman describes. @brcly, is that enough for the first condition while that loss is open, or would you rather see it repeated once it is fixed? The second condition stands as written above: no picture yet from these four walks in the scenes these runs reach.
The growing buffer is not pushed yet: one case is still open, a list that waits more than four presents between recording and execution could read a buffer already given back. It needs the wiring to make the list hold the buffer, which belongs in #596.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-01T15:21:49Z.
@3kynox thanks for narrowing it down so carefully. The fixed-size runs show the losses follow the buffer's size, and the growing buffer removes the never-mapped reads, which is real progress.
On your question: one run of two isn't enough for the first condition yet, so I'd keep #586 until the remaining loss is understood. What would settle it is the same build and settings with the switch off: if those runs lose the device at about the same rate with the same freed-then-read kind of fault, the loss isn't from the structures, and #586 can go in with the growing buffer. If the losses only come with the switch on, they're ours to find first.
#536 is merged on its own (see there), so #586 can rebase onto main. Please put the growing buffer and the list holding its buffer into #586 and #596 as you describe, since a list that waits more than four presents reading a buffer already given back would be the same use-after-free class we're chasing in #603. The second condition (a picture from these walks) stays as it was.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-02T13:13:20Z.
@brcly the switch-off control you asked for, now that #625 is fixed.
Setup. One tree, the same settings on both sides, 25-minute limit, runs alternated. RTX 4070 Ti SUPER 16 GB, 620.73.04, Intel CPU. The tree is
6d4f1cd7with #647 on top, becaused2985fb3, the main I started from, exits before the world here (#533); no other change. GE-Proton11-14, not the pinned 11-15. Default settings otherwise,VKD3D_CONFIG=faultandTUXBOX_TRACE_GPU_FAULT=1in every run. The only difference isTUXBOX_CONSOLE_STRUCTURES=1with the four distant-shadow walks listed. "World" counts from the first ray dispatch.8d02ef34)inline ray scene or geometry changed after recording, rejecting submissionFour of five end early with the switch off, three of five with it on. The freed-then-read fault comes twice on each side. The rejected submission also ended a run with the switch off at other settings, and #382 has it from builds without this code. The spread is wide, so five runs a side give no rate, but I see no loss that comes only with the switch.
Correction. I wrote on this PR that the 95,048-group indirect dispatch is over the host's limit.
vulkaninfogives 2,147,483,647 groups in X on this card (65,535 in Y and Z), so it is not over Vulkan's limit here.The indirect-light walks. On this tree the hit-resolve programs are emitted with 11 or 12 loops instead of 27. With every walk given the buffer the device is still lost soon after the walks are bound: Xid 109, one command in flight,
d2a8237e. So the second condition stays open: no visible effect to show yet.Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-03T07:40:27Z.
@brcly the three things you asked for before the console structures become a default.
A visible effect: yes. In ProjectScarlett's first playable scene, the right side of the room (the drawings on the wall, the bunk) is lit by indirect light with the structures on and goes black with them off. All nine walks are served, the programs that shade their hits run, and nothing is skipped. Alternating every 45 s from a still camera, it switched 5 times out of 5 each way in one run and again in a second, shorter one (
TUXBOX_READ_RESIDENCY=0in both). I haven't compared the colour with a console. A picture of the same view on and off follows in the next comment.What blocked it was in the translator: a ballot branched on the lane around its operand, and NVIDIA's compiled program never ended. The five-line change is #670.
The list that holds its buffer: merged in #644.
The off/on control: done for four walks, not met yet for all nine. The four-walk control is my previous comment here: ten runs, no loss that comes only with the switch, and that result stands. With nine walks and the shading programs running, three pairs on the same build: the device was lost in three runs of three with the switch on, and in one of three with it off. Most of those losses look like #603. One looks like ours: the fault address points to a walk reading outside the structures buffer, and I haven't found the cause. So the switch should stay off by default until I have, and I'll redo the control then.
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-03T07:42:57Z.
Left: structures on. Right: off. Same run, same still camera,
TUXBOX_READ_RESIDENCY=0.