Repository navigation
Conversation
|
Regression run of Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main
So with this PR, a launch on this title starts with a pass over every shader record of the pack, even with a warm cache. Unless that is meant to happen on every launch, it looks like the discovery picks up all records instead of the recipes earlier runs recorded, or the cache keys it looks up differ from the ones Update: this head is 36,287 added lines in 98 files against Update 2: with Not tested: how long the pass takes to finish here; a second launch after it finishes; the suite on this head; AMD. AI use: Claude Code (Claude Opus 5.5) ran these on this machine and wrote this report. |
|
Source review of
The preparation went on and the title started (RTX 5090, two runs). With this head, would those 3 now be found through the new Not tested: this head in the title. AI use: Gemini (Antigravity) flagged it in a review. Claude Code (Claude Opus 5.5) checked the source at |
|
Source review of
If a run ends mid-append, the Reading the history file with AI-assisted (Claude Code, Claude Opus 5.5): traced in the source at this head. |
|
Independent Windows / RTX 3090 verification of exact PR #2829 head System
Tested
Retail smoke check (no
Not tested
AI use
|
|
Follow-up to the truncated-history review, tested on exact head I reproduced the launch gate with the repository's synthetic test title and a title-scoped The smallest fix I found is a history-specific reader that accepts only an incomplete final frame header or payload and retains the verified prefix. A complete frame with a bad checksum or unsupported entry still fails. Completed worker job files retain their strict reader. Replacing the call with the older The new regression was red on the unmodified reader (0 passed, 1 failed) and green with this change (1 passed, 0 failed, 0 ignored; no skips): Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (driver 621.35), rustc 1.99.1 MSVC. Synthetic inputs only. Not tested: retail title, paired clean smoke, AMD or Intel. This is a candidate for the author, not a merge-readiness claim. Candidate diff against 1eb656bdiff --git a/crates/xcl/src/hle/d3d12x/gfx_records.rs b/crates/xcl/src/hle/d3d12x/gfx_records.rs
index da67c087..00187d8e 100644
--- a/crates/xcl/src/hle/d3d12x/gfx_records.rs
+++ b/crates/xcl/src/hle/d3d12x/gfx_records.rs
@@ -482,9 +482,9 @@ pub(crate) fn read(path: &Path) -> Vec<Vec<u8>> {
payloads(&file).map_or_else(Vec::new, |(list, _)| list.into_iter().map(<[u8]>::to_vec).collect())
}
-/// A completed worker job must contain only whole, supported records. A history file
-/// may be open for appends, so its reader above accepts a trailing partial entry.
-pub(crate) fn visit_payloads(path: &Path, mut visit: impl FnMut(&[u8]) -> Result<(), String>) -> Result<(), String> {
+/// A completed worker job must contain only whole, supported records. A title history
+/// may end inside an append after the previous run stopped.
+fn visit_payloads_with_tail(path: &Path, allow_incomplete_tail: bool, mut visit: impl FnMut(&[u8]) -> Result<(), String>) -> Result<(), String> {
use std::io::{BufReader, Read};
let file = std::fs::File::open(path).map_err(|e| e.to_string())?;
let size = file.metadata().map_err(|e| e.to_string())?.len();
@@ -498,10 +498,16 @@ pub(crate) fn visit_payloads(path: &Path, mut visit: impl FnMut(&[u8]) -> Result
while offset < size {
let damaged = || format!("damaged graphics job at byte {offset}");
let mut frame = [0; 8];
- if size - offset < 8 { return Err(damaged()); }
+ if size - offset < 8 {
+ if allow_incomplete_tail { break; }
+ return Err(damaged());
+ }
reader.read_exact(&mut frame).map_err(|_| damaged())?;
let len = u32::from_le_bytes(frame[..4].try_into().unwrap()) as usize;
- if len as u64 > size - offset - 8 { return Err(damaged()); }
+ if len as u64 > size - offset - 8 {
+ if allow_incomplete_tail { break; }
+ return Err(damaged());
+ }
payload.resize(len, 0);
reader.read_exact(&mut payload).map_err(|_| damaged())?;
if check(&payload) != u32::from_le_bytes(frame[4..].try_into().unwrap()) { return Err(damaged()); }
@@ -511,6 +517,10 @@ pub(crate) fn visit_payloads(path: &Path, mut visit: impl FnMut(&[u8]) -> Result
Ok(())
}
+pub(crate) fn visit_payloads(path: &Path, visit: impl FnMut(&[u8]) -> Result<(), String>) -> Result<(), String> {
+ visit_payloads_with_tail(path, false, visit)
+}
+
pub(crate) fn shader_payload(payload: &[u8]) -> Option<(u64, &[u8])> {
let (&tag, rest) = payload.split_first()?;
if tag != SHADER { return None; }
@@ -518,9 +528,9 @@ pub(crate) fn shader_payload(payload: &[u8]) -> Option<(u64, &[u8])> {
Some((r.u64()?, r.0))
}
-fn read_complete<T>(path: &Path, mut take: impl FnMut(&[u8], Entry) -> T) -> Result<Vec<T>, String> {
+fn read_complete<T>(path: &Path, allow_incomplete_tail: bool, mut take: impl FnMut(&[u8], Entry) -> T) -> Result<Vec<T>, String> {
let mut entries = Vec::new();
- visit_payloads(path, |bytes| {
+ visit_payloads_with_tail(path, allow_incomplete_tail, |bytes| {
let entry = decode(bytes).ok_or_else(|| format!("invalid graphics job entry {}", entries.len() + 1))?;
entries.push(take(bytes, entry));
Ok(())
@@ -528,12 +538,12 @@ fn read_complete<T>(path: &Path, mut take: impl FnMut(&[u8], Entry) -> T) -> Res
Ok(entries)
}
-pub(crate) fn read_complete_payloads(path: &Path) -> Result<Vec<Vec<u8>>, String> {
- read_complete(path, |bytes, _| bytes.to_vec())
+pub(crate) fn read_history_payloads(path: &Path) -> Result<Vec<Vec<u8>>, String> {
+ read_complete(path, true, |bytes, _| bytes.to_vec())
}
pub(crate) fn read_job(path: &Path) -> Result<Vec<Entry>, String> {
- read_complete(path, |_, entry| entry)
+ read_complete(path, false, |_, entry| entry)
}
/// What became of an entry handed to `Writer::add`.
@@ -886,6 +896,34 @@ mod tests {
assert!(read_job(&path).is_err());
}
+ #[test]
+ fn history_reader_keeps_verified_entries_after_an_incomplete_final_append() {
+ let dir = directory("history-tail");
+ let path = dir.0.join("history.bin");
+ let first = shader_entry(5, b"shader");
+ let mut writer = Writer::open(&path, u64::MAX).unwrap();
+ writer.add(&first).unwrap();
+ drop(writer);
+ let original = std::fs::read(&path).unwrap();
+ let mut writer = Writer::open(&path, u64::MAX).unwrap();
+ writer.add(&shader_entry(6, b"next")).unwrap();
+ drop(writer);
+ let complete = std::fs::read(&path).unwrap();
+ let second = &complete[original.len()..];
+ for tail in [&second[..3], &second[..second.len() - 2]] {
+ std::fs::write(&path, [original.as_slice(), tail].concat()).unwrap();
+ assert_eq!(read_history_payloads(&path).unwrap(), vec![first.clone()]);
+ assert!(read_job(&path).is_err(), "worker jobs still require whole frames");
+ }
+ let mut corrupt = original;
+ corrupt[HEADER + 8] ^= 1;
+ std::fs::write(&path, corrupt).unwrap();
+ assert!(read_history_payloads(&path).is_err(), "a complete but corrupt frame is not a torn append");
+ std::fs::write(&path, &complete).unwrap();
+ Writer::open(&path, u64::MAX).unwrap().add(&[0xff]).unwrap();
+ assert!(read_history_payloads(&path).is_err(), "an unsupported complete entry remains an error");
+ }
+
#[test]
fn legacy_pipeline_and_mesh_entries_share_version_one_history() {
let dir = directory("mesh-version-one");
diff --git a/crates/xcl/src/shaders.rs b/crates/xcl/src/shaders.rs
index 6855d394..4d60aa64 100644
--- a/crates/xcl/src/shaders.rs
+++ b/crates/xcl/src/shaders.rs
@@ -2062,7 +2062,7 @@ fn in_workers(workers: usize, records: usize, progress: &LaunchPreparation, mut
fn graphics_in_workers(inputs: &[Input], windows: u32, workers: usize, progress: &LaunchPreparation, staged_graphics: Option<&Path>) -> Result<(), String> {
let t0 = std::time::Instant::now();
let path = gfx_records::path();
- let local = if path.try_exists().map_err(|e| e.to_string())? { gfx_records::read_complete_payloads(&path)? } else { Vec::new() };
+ let local = if path.try_exists().map_err(|e| e.to_string())? { gfx_records::read_history_payloads(&path)? } else { Vec::new() };
let mut records = Vec::new();
let mut embedded = std::collections::HashMap::new();
for payload in local {AI use: Codex (GPT-6.2 Sol) traced the path, wrote and ran the candidate and tests; GPT-6.2 Astra reviewed the reader design. I checked the review points and results. |
Record supported console mesh streams with their fixed-function state and source shader keys. Replay through the existing graphics worker and two-pass translator to populate the runtime driver caches. Keep legacy graphics history compatible and leave unsupported streams to the existing runtime path.
Resolve shader and fixed-state selectors using a local layout profile. Publish a deduplicated native preparation job only after its recipes and shader references have been validated.
Share native replay between an offline CLI and the launch gate. Count successful recipes, propagate driver failures and cancellation, and scope recorded history to each title. Draw progress in the presentation window while workers prepare graphics, mesh and compute pipelines.
Avoid decoding the entire graphics job in both the launcher and worker. Validate the independent worker completion count and reject incompatible corpus configurations. Preserve cache reuse for inert mesh shader slots and cover the headless launch gate.
Match shader bytes and full graphics descriptors against the mandatory staged job. Keep distinct fixed-state variants and resolve their shader inputs from the staged corpus. A 48-recipe overlap fixture removed 48 redundant native submissions before the staged pass.
Limit record slicing to offline workers. An inherited slice from an earlier CLI run must not make the launch gate overlook an unstaged shader.
Use the intact prefix of optional history and defer records whose sources are still missing. Published worker jobs retain strict checks. Adapt the history reader regression contributed by thehollowedone.
Bind startup proofs to the driver, translation and pipeline ABI. Reuse only matching DXIL and validated native files, including both mesh passes. Restore the opt-outs for optional history and unstaged startup preparation while requiring published jobs to finish.
1eb656b to
dea6ae1
Compare
Exclude worker scheduling and observation settings from the preparation identity. Normalize Windows environment variable names, and report how many staged graphics recipes reused their existing native verification.
|
I checked the missing-source behavior on head
The test passed 1/1 with zero reported skips. Normal title first-use capture was observed in source to write a recipe; staged or worker inputs can also include shader entries. This synthetic check does not determine whether the missing sources reported for GTA VI can be recovered from its actual inputs. AI use: OpenAI Codex with GPT-6.2 Astra constructed and ran the synthetic test and inspected the source; Codex coordinated and prepared this report. |
|
Retested the all-missing historical-source case from my earlier report on updated head The updated test passed 1/1 without a reported skip. Mixed-source worker execution and GTA VI title behavior were not tested in this retest. AI use: OpenAI Codex with GPT-6.2 Astra inspected the updated source and ran the synthetic test; Codex coordinated and prepared this report. |
|
Follow-up to my missing-source retest: on The parent test contained a test-only override pointing at the real worker binary. This is a synthetic local integration, not a GTA VI title run or proof that its missing shader sources are recoverable. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the synthetic test; Codex coordinated and prepared this report. |
|
Tested: Not tested: Actual prelaunch GPU cache reuse, retail titles, and the full workspace suite. AI use: T3 Code / Codex ( |
|
Another synthetic prelaunch check on head
The receipt identity includes the ordered recipe list, so reordered grouping triggers native revalidation even though driver blobs can still be reused. This is a synthetic test, not a GTA VI launch or measured performance regression. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the synthetic test; Codex coordinated and prepared this report. |
|
@bmjask, a question about the archive-layout profile. On
AI use: Gemini (Antigravity) read the scripts and thread; Claude Code (Claude Opus 5.5) checked them and wrote this comment. |
|
Focused review of #2829 head I added a synthetic stream regression locally on the exact head. Before the correction, Candidate fix and regressiondiff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
index 7d81274c..e2975e8c 100644
--- a/crates/xcl/src/hle/d3d12x/real.rs
+++ b/crates/xcl/src/hle/d3d12x/real.rs
@@ -5821,6 +5821,32 @@ mod graphics_blob_tests {
assert_ne!(depth_bounds_key(key, true), key);
}
+ #[test]
+ fn gs_mesh_stream_preserves_depth_bounds_state() {
+ let mut d = D3D12_GRAPHICS_PIPELINE_STATE_DESC::default();
+ d.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_GREATER;
+ let mut keys = Vec::new();
+ for enabled in [false, true] {
+ let mut stream = StreamOut::default();
+ put_gs_depth_stencil(&mut stream, &d.DepthStencilState, enabled);
+ keys.push(unsafe { two_pass_stream_key(&stream.0, &[], 7, 0) }.unwrap());
+ let fields = stream_subobjects(&stream.0).unwrap();
+ let (ty, bytes) = fields.iter().find(|(ty, _)| {
+ *ty == D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL.0 as u32
+ || *ty == D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1.0 as u32
+ }).unwrap();
+ if enabled {
+ assert_eq!(*ty, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1.0 as u32);
+ let state = unsafe { std::ptr::read_unaligned(bytes.as_ptr().cast::<D3D12_DEPTH_STENCIL_DESC1>()) };
+ assert!(state.DepthBoundsTestEnable.as_bool());
+ assert_eq!(state.DepthFunc, d.DepthStencilState.DepthFunc);
+ } else {
+ assert_eq!(*ty, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL.0 as u32);
+ }
+ }
+ assert_ne!(keys[0], keys[1], "depth bounds must distinguish native graphics cache entries");
+ }
+
#[test]
fn graphics_blob_key_tracks_shaders_samplers_and_state() {
unsafe {
@@ -6280,7 +6306,7 @@ unsafe fn translated_graphics_pso_once(this: *mut c_void, f: PsoFn, desc: *const
}
if let Some(gs) = shader_bytes(&d.GS).filter(|g| is_console(g)) {
let _ = f;
- return Some(translated_gs_pso(this, d, vs, gs, riid, ppv));
+ return Some(translated_gs_pso(this, d, vs, gs, depth_bounds, riid, ppv));
}
// a GPU that can run 32-lane waves may run a wave64 VS / PS in waves of 32 (the driver
// picks; RDNA2 does for pixel shaders): the lanes 32..63 it reads come from `upper_lanes`
@@ -7909,9 +7935,17 @@ unsafe fn translated_mesh_stream_once(this: *mut c_void, desc: *const c_void, ri
Some(hr)
}
+fn put_gs_depth_stencil(out: &mut StreamOut, state: &D3D12_DEPTH_STENCIL_DESC, depth_bounds: bool) {
+ if depth_bounds {
+ out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1, &super::gfx_records::depth_stencil1(state, true));
+ } else {
+ out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, state);
+ }
+}
+
/// A graphics PSO with a console VS + GS: the GS pipeline in two passes, as a mesh pipeline
/// with the description's state.
-unsafe fn translated_gs_pso(this: *mut c_void, d: &D3D12_GRAPHICS_PIPELINE_STATE_DESC, vs: &[u8], gs: &[u8], riid: *const GUID, ppv: *mut *mut c_void) -> HRESULT {
+unsafe fn translated_gs_pso(this: *mut c_void, d: &D3D12_GRAPHICS_PIPELINE_STATE_DESC, vs: &[u8], gs: &[u8], depth_bounds: bool, riid: *const GUID, ppv: *mut *mut c_void) -> HRESULT {
let (tp, (ps, ps_samplers)) = match (
crate::gpu::recomp::pso::console_geometry(vs, gs, shader_bytes(&d.PS), wave32_only(this)),
two_pass_ps(shader_bytes(&d.PS), graphics_wave32(this)),
@@ -7969,7 +8003,7 @@ unsafe fn translated_gs_pso(this: *mut c_void, d: &D3D12_GRAPHICS_PIPELINE_STATE
out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND, &blend);
out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, &d.SampleMask);
out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER, &d.RasterizerState);
- out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, &d.DepthStencilState);
+ put_gs_depth_stencil(&mut out, &d.DepthStencilState, depth_bounds);
out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS, &rt);
out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT, &dsv);
out.put(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, &d.SampleDesc);This needs a real GPU recipe/replay check on a depth-bounds-capable adapter and a clean-head paired smoke before merge. I did not run those or the full workspace suite on this uncommitted candidate. No proprietary inputs were used. AI use: Codex (GPT-6.2 Sol) wrote and ran the local regression and fix; Codex (GPT-6.2 Astra) independently traced the path. |
|
Follow-up to my depth-bounds finding: I checked the geometry-shader path with a native GPU worker replay and ran clean-commit smoke checks. The unmodified PR head is On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, the new synthetic VS+GS worker test makes both native pipelines, one with depth bounds and one without. On the unchanged PR head it failed: both recipes produced the same mesh-pipeline cache entry. With the local correction it passed cold and warm replay: two distinct mesh entries, one shared compute entry, two pipelines made, zero failures. The full The following Generated smoke blocks
PR head: Local candidate: The bounded correction forwards |
Stacked on #2828 against
nvidia-dev. Related to #2088.What and why
Known pipeline recipes can be prepared before guest entry. A verified driver artifact survives a diagnostics-only rebuild when the adapter, driver, translation settings and pipeline layout are unchanged. The offline command and the game window use the same staged corpus and validate native completion before reporting success.
What is in it
Discover shader sources and fixed-state variants from archive tables using a local layout profile. Stage one or more journals as a single deduplicated native workload.
Run
xcl shaders <folder> --prepare-corpus --threads 8for offline graphics, two-pass mesh and compute preparation. Select up to 32 workers.Gate ordinary launch on preparation. The game window draws a progress-lit wireframe and reports progress and stalls. Cancellation and failed staged recipes prevent guest entry.
Reuse verified pack DXIL and compute, graphics and both mesh-pass blobs. Corrupt proofs and missing or replaced output files fall back to preparation.
Recover optional recorded history after a torn append. Unknown history tags and missing optional sources leave usable records available. A staged job still requires all sources and every frame. The history reader and its regression build on thehollowedone's review.
Restore
XCL_PREPARE=0for unstaged startup andXCL_PREPARE_GRAPHICS=0for optional graphics history. A staged corpus retains its launch gate.Tested
Revision
dea6ae17changes tested on Windows 11 build 26200, Core i9-12900K, GeForce RTX 4090 driver 610.88, rustc 1.100.0 MSVC, debug.python -B -m unittest discover -s scripts/pso_corpus -qreported 15 passed, 0 failed and 0 skipped.cargo test --locked -p xcl --lib shaders::warm -- --test-threads=1reported 3 passed, 0 failed, 0 ignored and no skips. The targetedhistory_reader_keeps_verified_entries_after_an_incomplete_final_appendtest also passed (1 passed, 0 failed, 0 ignored and no skips).On clean head
e2b2eaf2, two separately linked Windows debug executables differing only in a progress diagnostic ran the standalone corpus command on the same adapter and cache. The second executable verified both known graphics recipes (classic and two-pass mesh) and the compute recipe from disk. All 3 completed with exit 0. A subsequent direct worker reported 2 verified recipes and 0 driver blob loads/writes.cargo test --locked -p xcl --lib warm_settings_ignore_worker_identity -- --test-threads=1: 1 passed, 0 failed, 0 ignored, no skips.On
e2b2eaf2,cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture: 1,837 passed, 8 failed, 48 ignored across 40 targets, 27 SKIPPED notices. Failures covered compute thread limits, a deferred sparse mapping, two texture-upload tests, the AS-slot mesh diagnostic, async compute registration, split compute and two-pass cleanup. All preparation receipt, history recovery and headless launch-gate tests passed. GPU skips do not count as hardware coverage.Hosted Windows CI on this head exited in sparse tests with
DXGI_ERROR_DEVICE_REMOVEDafter a 3 GiB GPU-view reservation. The software-adapter detection proposal Tests: sparse tests take CI's Basic Render Driver for a software device #2837 describes this symptom.The following evidence is from earlier revisions of this PR:
Windows x64.
python -B -m unittest discover -s scripts/pso_corpus -vpassed 15 tests, with zero failures or skips.Staged 84,228 graphics and mesh recipes plus 2,734 compute recipes from local journals. Readback verified the counts. Archive discovery requires a profile for the archive revision.
A local archive-layout profile produced 84,796 distinct source-derived recipes. Separate inputs provided static derivative mappings. The staged set includes byte-for-byte matches for all 82,612 recipes in a held-out capture. Other titles need suitable profiles.
On a GeForce RTX 4090, the public offline command prepared 24/24 archive-derived recipes (8 classic graphics, 8 two-pass mesh, 8 compute), wrote 32 native blobs, and exited successfully in 39.1 s with 2 workers and an initially empty application cache. A separate three-recipe test confirmed a second process could restore both mesh blobs.
The repository's test title prepared 768/768 generated compute recipes in its own window and returned 0. The old preparation-disable settings were set during this run. A headless failure test also passed. With 48 sources supplied both loose and staged, native submissions in the loose pass fell from 48 to zero, all 48 staged recipes were confirmed, and both title runs exited successfully. Separate mixed and fully covered packs verified worker routing.
cargo build --workspace --lockedpassed on Windows x64. On head1eb656b4,cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 1,762 passed, 5 failed and 48 ignored across 40 targets. Sixteen reported-pass tests logged 26 skipped GPU subcases. All five failing tests also failed on the clean Shaders: replay compatible two-pass mesh pipelines at startup #2828 base: two texture upload tests, the AS-slot mesh diagnostic, async compute registration, and two-pass state cleanup. All head launcher end-to-end tests passed.Regression run
The current head has no paired retail smoke results. The earlier main and nvidia-dev reports in review comments cannot supply a clean run of this head.
Not tested
Current-head retail gameplay, paired regression smoke and AMD hardware. Complete native compilation of the largest staged corpus on this branch. Gameplay coverage beyond supplied recipes and matched history.
AI use
Codex, GPT-6, implemented and reviewed the changes and ran the checks.