Repository navigation
Conversation
Adapt upstream VIctory commits c47b529 and 9c58a1c to the fork GPU runtime and retain the fork pipeline library. Key shader cache entries by the effective wave width and descriptor limit so warm-up and play use matching translations.
Persist deterministic unsupported results and atomically replace corrupt cache entries. Let offline pipeline warm-up focus on the exact keys recorded by prior title runs.
dbe15c9 to
73c9d1a
Compare
|
Thanks for this. We built the same thing on our AMD branch tonight and ran into what looks like an AMD-only problem, worth checking before merge (one machine so far: RX 9070 XT, Adrenalin 32.0.32029.2010):
What made the prebuild finish here: write the pipeline in flight to a file before handing it to the driver, save the library every ~200 pipelines, and on the next run retest the in-flight ones alone and skip the one that crashes (kept in a prebuild-crashed list). A full prebuild then completed in ~10 min. Happy to share the patch if it helps: https://github.com/PastiiJay/klbf-lab |
…lation, translations kept across rebuilds
…precompilation Fixes #17 Adds `victory translate --cache [--pipelines [--used-pipelines]]`, the shader-pack/SGD5 effect readers (shaderpack, pipelines, cityhash), the pipeline pre-build (pipeline::Prebuild, library::keep_early_list) and checksummed, atomically published shader cache records that also keep deterministic Unsupported refusals. Shader cache key (one coherent key, union of both sides): - build(): main's key() over CACHE_SCHEMA_VERSION + victory_shader::SOURCE_HASH (or the exe with VICTORY_SHADER_CACHE_KEY=exe), loop limit, group_sync, VICTORY_WAVE_WIDE/DEEP_SKIPS/OWN_BITS/F16_NEAREST, shader_opt, portable_heap. - target_key(): build() + emit::translation_limits() (host wave, view heap limit) + VICTORY_WAVE_LOCAL/STRICT_JOINS/MESH_OUTPUT_STRICT/REF_VS/REF_PS/ VICTORY_DXIL_VALIDATE (covers the PR's extra switches too). - entry = CacheKey::from_parts("shader.dxil", 2, [target_key, canonical container]); the PR's lookup re-reads the limits after translating and does not store if they changed. - SOURCE_HASH: the PR's build.rs (all src files, manifests, Cargo.lock, rustc -vV, target, features) replaces main's .rs-only hash (superset). - Main's DXIL validation (VICTORY_DXIL_VALIDATE, off by default) and VICTORY_SHADER_FAILURE_DIR stay on the translate path used by both the run and the warm-up; validator refusals are not cached (only ShaderError::Unsupported is). is_cached() (early-start readiness) uses the same key and the canonical container. Pipeline library / make.rs: main's behaviour kept as is (per-writer staging, SAVE_IO + WRITING, priorities, worker pool, skipped pipelines not started early, prewarm); the PR only adds make::key(), the pub(super) key field and keep_early_list(). Other resolutions: - main.rs: kept --host-lanes and cfg(windows) translate; added --cache path and --used-pipelines; --cache conflicts with --host-lanes (the warm-up translates for this host's adapter). shader-info gets --effects plus main's traversal-error reporting. - victory-shader stays on zlib-rs (main): dropped the PR's miniz_oxide; shaderpack::find and its/sgd5's tests ported to zlib-rs. sgd5::records now returns a Vec (PR), main's stream tests adapted. - emit: exports host_max_wave, view_heap_limit, translation_limits, portable_heap. Removed a duplicate [build-dependencies] and a duplicate victory-gpu dependency git auto-merged, and the unreachable non-Windows warm() stub. README keeps both sections. - Opt-in defaults unchanged (VICTORY_WAVE_WIDE_LAST, VICTORY_DXIL_VALIDATE, VICTORY_SKIP_STALE_LISTS, VICTORY_TEXTURE_CATCHUP off). - emit/lower.rs: 500,091 bytes (< 524,288), no move needed. Checks: - cargo clippy --workspace --lib --bins --tests -- -D warnings: clean - cargo test --workspace --lib --bins --tests: 623 passed, 0 failed, 11 ignored (one earlier run had victory-gpu exit with an access violation; 15 reruns, parallel and serial, passed) - cargo run -p xtask -- policy: 193 files ok Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0146F6Kp6fVRXG2Mpsbn6u8L
|
Independent Windows 10 / RTX 4080 verification of the offline cache path I merged this PR onto Machine: Windows 10 22H2 (19045), RTX 4080 16 GB, driver 621.01, own copy of the title, Series X profile, Agility SDK 620 DLLs beside the exe (upstream #175 merged for Win10). Settings during precompile: no
For comparison, the same precompile on upstream I've started a title run against this warm cache; I'll add whether the lit frames and 0 device removals match the runtime-warmed run. Counts only; no game files. AI-assisted (Claude Code, Claude Opus 5.5); measured on my machine. |
|
Result of the title run on the warm cache from my earlier comment: it renders lit, no removal
So the offline precompile did not change the picture: the lit world is still there, and the 30-minute cold-start glitchiness is gone. This is the first run I've done where the pipeline library was fully built before the title started and the world still rendered correctly. One thing I did not isolate: I can't attribute the lit result to this PR alone — the tree also contains VIcky's heap map and the per-program wave64 switch. What this PR contributes is the warm start and the exact cache keys. Counts only; no game files. AI-assisted (Claude Code, Claude Opus 5.5); measured on my machine. |
|
Disclosure correction for my two comments above (1, 2): HY4 Flash ( Rechecked against the log: the warm-cache title run lasted 599 s with no device removal and 9 untranslated programs, as stated. This correction: Claude Code (Claude Opus 5.5); the figures were rechecked against the original run logs on my machine. |
…lation # Conflicts: # README.md
…lib_rs + CBV clamp
Summary
victory translate --cacheto populate the runtime shader cache from local shader packs and containers. Entries follow the translator, effective settings and adapter shader capabilities, so app-only rebuilds can reuse them.--pipelinesto populate the host D3D12 pipeline library. Use--used-pipelinesto focus on exact keys recorded by earlier runs while still translating all shader inputs.Related work
#147 proposes translator-based keys and early-worker scheduling. #35 and #199 address specific wave-mode inputs to cache keys. This PR adds offline shader translation and host pipeline creation. The cache-key changes overlap those PRs.
Verification
victory,victory-game,victory-gpuandvictory-pipeline. One existing benchmark was ignored.cargo xtask policypassed.AI-assisted.