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

+25 -15
View File
@@ -233,8 +233,11 @@ fn translate(container: &[u8]) -> Result<Translated, String> {
/// So a builder dispatch runs only while every builder pipeline the title
/// has created has a host pipeline; the first builder dispatch makes them
/// all on the spot instead of over the next frames (a stage "still being
/// made" would be a dropped stage). One that cannot be made turns the
/// builder off for the rest of the run.
/// made" would be a dropped stage). While one cannot be made the builder
/// is off; it is looked at again when the title creates another. A stage
/// that could not be bound stops the stages after it for the rest of that
/// frame and the next ([`builder_rests`]); it turned the builder off for the
/// rest of the run at first.
///
/// shortcut: and only with `VICTORY_BVH_BUILDER=1`, until a run has shown
/// the whole builder and the host side of title memory by address
@@ -245,15 +248,18 @@ struct Builder {
pipelines: Vec<Arc<make::Pending>>,
/// Every one of `pipelines` has a host pipeline.
whole: bool,
/// One could not be made.
off: bool,
/// One could not be made, of so many (0: none).
off: usize,
/// No stage runs before this frame.
rests: u64,
}
#[cfg(windows)]
static BUILDER: Mutex<Builder> = Mutex::new(Builder {
pipelines: Vec::new(),
whole: false,
off: false,
off: 0,
rests: 0,
});
/// Whether `shaders` are a pipeline of the structure builder.
@@ -292,13 +298,15 @@ pub(crate) fn is_builder(this: This) -> bool {
!this.is_null() && pipeline(this).builder
}
/// A stage of the builder was dropped after all: none runs from here on.
/// A stage of the builder was dropped after all: none runs for the rest of
/// this frame and the next (what it fed is not there).
#[cfg(windows)]
pub(crate) fn builder_off(why: &'static str) {
pub(crate) fn builder_rests(why: &'static str) {
let mut b = BUILDER.lock().unwrap_or_else(|e| e.into_inner());
if !b.off {
b.off = true;
tracing::warn!(why, "the ray-tracing structure builder is turned off for the rest of the run: its stages run all or none");
b.rests = crate::frame::current() + 2;
static SAID: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0);
if SAID.fetch_add(1, std::sync::atomic::Ordering::Relaxed) < 20 {
tracing::warn!(why, "the ray-tracing structure builder rests for this frame and the next: its stages run all or none");
}
}
@@ -311,22 +319,24 @@ pub(crate) fn builder_runs() -> bool {
return false;
}
let mut b = BUILDER.lock().unwrap_or_else(|e| e.into_inner());
if b.off {
if b.off == b.pipelines.len() || crate::frame::current() < b.rests {
return false;
}
if b.whole {
return true;
}
let missing = b.pipelines.iter().filter(|p| !make::now(p)).count();
if missing > 0 {
b.off = true;
let missing: Vec<String> = b.pipelines.iter().filter(|p| !make::now(p)).map(|p| make::hashes(p)).collect();
if !missing.is_empty() {
b.off = b.pipelines.len();
tracing::warn!(
missing,
missing = missing.len(),
of = b.pipelines.len(),
which = ?missing,
"the ray-tracing structure builder stays off: not all of its programs have a host pipeline, and its stages run all or none"
);
return false;
}
b.off = 0;
tracing::info!(
pipelines = b.pipelines.len(),
"the ray-tracing structure builder runs: all of its programs have host pipelines"