Skip to content

Structure builder: the last three programs translate on 32-lane hosts; steadier intro - #294

Open
ALFREDOHDEZ wants to merge 3 commits into
fxceless:mainfrom
ALFREDOHDEZ:fix/builder-prefix-sums-and-intro
Open

ALFREDOHDEZ wants to merge 3 commits into
fxceless:mainfrom
ALFREDOHDEZ:fix/builder-prefix-sums-and-intro

Conversation

@ALFREDOHDEZ

Copy link
Copy Markdown

Three independent changes, one commit each. Tested on an RTX 4070 (621.24), Ryzen 7 5800X3D, 32 GB, Windows 11.

1. First-lane reads of values alike in every running lane

On a 32-lane host the structure builder stayed off because 3 of 53 programs (39321a95223001ed, 77360df21e12ea43, 9fc111d3be79364f) stopped with "a first-lane read where not every lane runs". They are prefix sums: the value read is a scalar plus ds_read_b32 at a uniform address, so every running lane holds the same. The new rule follows only unguarded v_mov_b32, v_add_nc_u32 and ds_read_b32.

All three now translate, validate and get a pipeline on the RTX 4070, and the builder reports that all 53 pipelines run.

2. Only the structure builder names memory by constants and writes by address

  • Programs that walk the structures declared every numbered copy written, so VICTORY_BVH_QUARANTINE=1 leaked into title memory. In one run before this change the title crashed about 13 s after the builder started; after it, one run lasted 400 s.
  • In the programs I saved from a run, 70 use raw addresses; only 11 store through them, all unnamed ones (the builder's, as far as I can tell).

3. Two pipeline workers until the title draws a world

With over 1,000 pipelines queued, eight workers made the intro vary between 14 and 32 fps. With two workers it stayed at 30 (29 to 30.2). I also stopped writing captures during the intro, so part of the gain may come from that. The world's first frames may wait longer for pipelines on a cold cache.

Not fixed

  • Nothing is lit by ray tracing yet, and everything stays off by default.
  • With the builder on (quarantine too) meshes are deformed and the picture is darker: its stores reach host copies that meshes also read.
  • The 1,023-copy limit is still reached about 7 s after the builder starts.

Measurements that may help (same save and spot, no input, 2 min into the world)

Switch ms/frame GPU column
default 435 212
VICTORY_LATE_WAIT=3 347 88
VICTORY_INDIRECT_WINDOW=1 472 211

The input was not fully controlled in the last two runs, so take those as approximate. Putting sampled textures in shared 64 MB heaps gave no gain and is not included.

Tests

victory-shader: 210 passed on this branch. Clippy (-D warnings, victory-shader and victory-gpu) is clean. victory-gpu: 110 passed on an earlier base with these changes; not re-run on this one. The game runs above were also on that earlier base. No unit test is added for the new rule.

🤖 Generated with Claude Code

ALFREDOHDEZ and others added 3 commits November 24, 2026 23:19
The structure builder's prefix sums read a sum of scalars and shared memory at a uniform address with v_readfirstlane; on a 32-lane host that was refused and kept the whole builder off (3 of 53 programs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…by address

Programs that walk the structures declared every copy written, which let the builder's quarantine leak into title memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
javijmgdev added a commit to javijmgdev/nootnoot-fork that referenced this pull request Nov 25, 2026
With it, the next run (cold shader cache) showed walls and objects missing that 24cff03 drew. Its draw.rs change stops making ready the title memory that non-builder programs read by address from root constants, and stops declaring their writes; that is on the default path. Reverting also brings back the translator of 24cff03, whose shader cache is already filled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Krashgamer

Copy link
Copy Markdown

Tested on an RTX 3080 10 GB (32-lane), i7-10700K, 32 GB, Windows 11 26200, driver 610.88. Tree: fork main c96b4f2 + this PR (947d8b6), diag build, Series X profile, scripted Enter only (no pad input), 300 s runs. Switches: VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1, plus #176's set (VICTORY_DISPLAY_MODE=1920x1080 VICTORY_LATE_WAIT=3 VICTORY_SHADER_LOOP_LIMIT=4096, rest now default).

Not tested: longer runs, lighting (nothing reads the structures yet).

AI-assisted: Claude Code (Claude Opus 5.5) built, ran and measured this and wrote the comment; numbers are from our run logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants