Structure builder: root views as memory by address, windows of its own on the card, upload memory below 2^37

The ray-tracing structure builder's 52 programs translate, validate and make
host pipelines on the 7900 XTX (its waves have 32-64 lanes). What kept it from
working, from a first run (light-1, VICTORY_BVH_QUARANTINE=1) and the code:
- a root view ends with the host copy (a 4 MiB window); structures of megabytes
  cross it. Programs with a spilled user-data table now reach what their root
  views name by address (USER_ROOT_ADDRESS), as upstream VIctory 0f637570 does.
- the list's upload memory (instance descriptions) came from the process heap,
  above 2^40, where shaders' addresses do not reach (upstream 0f637570, 6d021fe3).
- the 1,023 numbered copies of 4 MiB ran out in the first frame: pages come in
  windows of 256 KiB (4 MiB around what a dispatch names), 16,383 at most.
- what the builder stores came back to title memory; now only what it stores in
  small title buffers it names (sizes the title reads).
- the directory lay in the PC's memory and every access stored a fault note.
- a list without a view heap gets the title's; a dropped stage rests the builder
  for a frame, not for the run.
Off unless VICTORY_BVH_BUILDER=1, as before. VICTORY_UPLOAD_LOW=0,
VICTORY_LENT_HEAP=0, VICTORY_MEMORY_WINDOW_KB, VICTORY_MEMORY_CARD_MB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 03:11:24 -06:00
1 parent 0abcb9fd89
commit 87eb9f2449
13 files changed
+727 -177

No files matched your search

+4 -2
View File
@@ -251,7 +251,6 @@ impl<'a> Lower<'a> {
/// computed, `offset` fixed; none of the node's bytes past 127), read
/// four at a time.
fn bvh_node_words(&mut self, at: NodeAt, base: Option<V>, offset: u32, count: u32) -> Vec<V> {
let c = self.cur;
let (undef, align) = (self.s.m.undef(self.s.t.i32), self.s.m.i32(4));
// The second half of a 128-byte node may lie in the next 64 KiB
// page, which may be in another copy: its own look, made once.
@@ -267,10 +266,11 @@ impl<'a> Lower<'a> {
let (low, high) = self.address_plus(low, high, 64);
// Every lane in this block runs the instruction.
let (handle, byte) = self.bvh_memory(low, high, None);
let k64 = self.s.m.i32(64);
let (k64, c) = (self.s.m.i32(64), self.cur);
(handle, self.s.m.bin(c, Bin::Sub, byte, k64))
}),
};
let c = self.cur;
if let Some(b) = base {
byte = self.s.m.bin(c, Bin::Add, byte, b);
}
@@ -330,6 +330,8 @@ impl<'a> Lower<'a> {
let k16 = self.s.m.i32(16);
let words = self.bvh_node_words(at, None, 16, 24);
let floats: Vec<V> = words.iter().map(|&w| self.as_float(w)).collect();
// (The look for the second half goes on in another block.)
let wide_block = self.cur;
self.s.m.terminate(wide_block, Term::Br(join));
// 16-bit floats: 24 halves in 12 dwords from byte 16, the low half
// of a dword first.