Commit Graph

390 Commits

Author SHA1 Message Date
14b5825881 Merge pull request #497 from Rain156/feat/native-graphics-shader-index
Merging.

**Why merged:** Indexes the DXBC identities the Xbox native graphics pipelines use, which the native-PSO path needs. The earlier hold (new tool not listed as a translator input) is fixed in 62a95883b: native_pso_hashes is now in translator_deps.cmake, make_game.py's translation sources and runtime.yml.

**Why it's good:** Security read of the three-dot diff: tools and tests only, no binaries, downloads or network calls. The PR's own tests: 129 passed. The consistency set, which caught the missing input registration last time, is clean now.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 08:36:39 -05:00
aa8be9aef2 Integrate the offline first-run UI runtime with current main and the published renderer fixes
Use the tagged pipeline variants and indexed quad expansion from #722 and #682 with the shared shader cache. Retain title-backed index uploads, cross-queue scratch sharing, amd64 console return conventions and the PC/console caller discriminator. The local shader build indexes native containers and includes the executable's embedded stages.
2026-11-24 21:26:25 +08:00
831584b21a Integrate #497 for the Windows first-run UI 2026-11-24 21:10:57 +08:00
6e15812e58 make_game: a probe file there with another size keeps the unsupported-version message (BUILD-2835 review)
A complete copy of another build has every file, with only the probe files at other sizes. That folder
cleared the half threshold and was told to finish a download that is complete. A download that stopped
early leaves files missing, while a probe there with another size (MicrosoftGame.Config above all) means
another package. So partial_version_message() now gives way to the "doesn't look like a supported version"
message, which lists the probe sizes, whenever a probe file is present with another size, even if other
files are missing too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:54:45 -05:00
6e673f5c7a make_game: a file whose metadata can't be read is not reported as missing (BUILD-2835 review)
manifest_presence() counted every OSError from os.stat() as a missing file, so a probe that raised
PermissionError could be listed as missing with "Finish the download". As in probe_mismatches(), only
FileNotFoundError and NotADirectoryError now count as missing; any other OSError is listed apart as
"cannot read <name> (<reason>)", with advice to make the file readable. "Incomplete copy" and "Finish the
download" appear only when a file is missing or has another size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:54:45 -05:00
bd9a092a7f make_game: an incomplete copy is named as a partial match of its version, with what is missing (BUILD-2835)
load_version() only looks at the three probe files, so a copy whose download stopped before one of them
was reported as "This doesn't look like a supported version of the game", the same as another game. When
no version matches its probes, the folder is now compared with each manifest by name and size; if it holds
at least half of one version's files with matching sizes, the error names that version, how many files
match, and lists the missing files (with their total size) and the ones with another size. A folder below
half keeps the old message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:54:45 -05:00
609206ecb3 Merge pull request #604 from Headache3318/fix/stage-dep-cache-decoder-tools
make_game: the stage tool lists must name the decoder they run through (STAGE-DEP-CACHE)
2026-11-24 07:47:16 -05:00
cf73e3497a make_game: warn when the runtime stage runs without VULKAN_SDK
preflight checked VULKAN_SDK only for the pipelines stage. On Windows the
runtime stage without it passes preflight and can build a runtime without the
Vulkan D3D12 device, because build_runtime.ps1 requires Vulkan only when the
variable is set. LEONIDA_D3D12=vulkan is then ignored silently.

preflight now logs a warning for that case and leaves the build running, since
a runtime without Vulkan is still valid. Three tests cover an unset and an empty
variable, the variable set, a prebuilt --runtime-build and a non-Windows system.
2026-11-24 14:41:16 +04:00
62a95883b6 build: track native PSO catalog dependencies
Track the catalog writer and its local imports in the shader-stage fingerprint
and CMake fixture dependencies. Cover the same files in both Runtime event
filters, including the optional native scanner reached by the carver.
Check both import graphs and document the standalone catalog refresh for
existing translations.

On Windows x64, touching the writer rebuilt the three bindless fixtures once.
All three passed spirv-val and both Vulkan bindless tests passed on an RTX
5070 Ti with driver 617.42. The semantic suite ran 6,108 tests with no failed
files. The regenerated 25,321-row catalog matched the local reference byte
for byte.

AI-assisted: OpenAI Codex
2026-11-24 18:13:26 +08:00
9e77e974ee Merge remote-tracking branch 'upstream/main' into feat/native-graphics-shader-index 2026-11-24 18:06:59 +08:00
21625bca8c Merge pull request #558 from JiyouProt/codex/shader-index-atomic
Why merged: each rdna2spirv index write now uses its own staging file and cleans it up, so parallel translations can't clobber each other's index; and, after review, the new tools/file_mode.py is registered as a translator input (translator_deps.cmake, make_game.py's translation sources, runtime.yml paths).
Why it's good: re-tested at e4dc13b on main d7576d5 (Windows 11, RTX 4070 SUPER): the new index-write tests go from 2 passed / 10 failed on main to 8 passed; the translator-input tests stay 56/56; the full repo-consistency set is 565 passed / 0 failed; compileall clean. Thanks @JiyouProt for the quick fix.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 04:50:35 -05:00
76b9d170cb make_game: the stage tool lists must name the decoder they run through
Claimed in the coordination issue as: STAGE-DEP-CACHE (#14).

FSPX_TOOLS, LIBRARY_TOOLS and BVH_TOOLS key the shaders, pipeline-library and BVH caches on the bytes of the
programs that produced them, but none of them names the decoder half of the chain: fspx_unpack.py --disasm imports
shader_disasm.py (tools/fspx_unpack.py:205), which decodes through rdna2_decode.py, its tables and mc_command.py. An
edited decoder therefore left the old listings in the cache and got them translated again, so the fix was in the
cache, not on the disk. The library stage also carves with shader_carve.py (tools/shader_library.py:201), which was
not listed either.

tests/test_shader_stage_resume.py gets a case that fails when a module the chain imports is missing from the list,
so the next link added to the chain cannot be left out silently again.

AI-assisted (Hermes agent on behalf of @Headache3318). Tested at base 7430f59b2 on Arch Linux, 8-core x86-64,
python 3.14.9, with the repo's standard-library tests: test_shader_stage_resume, test_bvh_shaders_stage,
test_fspx_shaders_stage and test_make_game_resume all OK; python -m compileall -q make_game.py tools tests exit 0;
git diff --check clean; scripts/check_no_game_data.py make_game.py tests/test_shader_stage_resume.py exit 0. No game
package on this machine, so no corpus count and no shaders-stage resume run against a real work folder; no GPU run.
2026-11-24 04:47:04 -05:00
e4dc13b079 build: declare file_mode in translator dependency lists
Address review of #558: include file_mode.py in CMake shader dependencies,
make_game translation source digests, and both Runtime workflow path filters.
AI-assisted with Codex.
2026-11-24 10:35:33 +01:00
4d64b64d1b translator deps: list rdna2_decode and rdna2_isa_tables
Since #462, tools/rdna2spirv.py imports rdna2_decode, which imports rdna2_isa_tables. Neither module was in the
three lists that track what the translator reads: LEONIDA_TRANSLATOR_DEPS (runtime/cmake/translator_deps.cmake),
TRANSLATION_SOURCES (make_game.py) and the runtime workflow's path filters. So test_cmake_translator_deps,
test_shader_stage_resume and test_runtime_paths fail on main, and an edit to the decoder neither rebuilds the GPU
test shaders, nor reruns translation, nor starts the runtime workflow.
2026-11-24 07:58:02 +01:00
1740e093c9 shaders: index DXBC identities for Xbox native graphics pipelines
Generate a deterministic hash-to-stage catalog alongside the translated shaders. Backfill an existing translation without disassembling it again, reject conflicting identities, and atomically replace a complete catalog.

Adapted from the GPL native stage index by enx, with the Xbox layout measurements by LooperSalty and KkelebekK.

Adapted-from: 5c175db901
2026-11-24 14:25:53 +08:00
2c03f29783 make_game: parse quoted paths with spaces in tool_available 2026-11-24 11:09:18 +05:00
031bab29f8 Repair zero-byte DDS files on TTPF resume
Require a non-empty file before the manifest or exporter considers a DDS complete. Rebuild empty outputs through the atomic writer and cover skipped rows and surviving siblings with synthetic tests.
2026-11-24 00:38:33 -05:00
cb09db363a make_game: honor --jobs when verifying package hashes 2026-11-24 13:09:13 +08:00
c07ec72c49 Merge pull request #227 from bhimio1/feat/linux-native-support
Linux: versioned llvm-mc, Build.sh/Mods.sh, case diagnostic, portable runtime tests, docs/linux.md
2026-11-23 22:36:28 -05:00
388f2fcda6 Merge pull request #149 from natterman12/dashboard/d3d-issue-lookup
progress_dashboard: find the D3D12 tracking issue by title, not as #313 (DASH-D3D-ISSUE)
2026-11-23 22:10:18 -05:00
aba2409915 Merge main (84347bbb6): the pipeline-library stage of #19 next to the executable's embedded shaders
make_game.py and tests/test_library_shaders_stage.py are main's (parallel library translation, the shard plan,
verify_fspx_key_clash), with the exe_shaders call kept. shader_library.h still loads the exe folder after
library; shader_library_test keeps one copy of the library case.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
2026-11-23 21:03:23 -06:00
1a04df0b1b Merge main (9ec34cdff) into the frame-loop boot stack
The stack is ladder-frame (ASTROWwwW's integration of the retail boot pull requests) with the old pull requests
7604, 7286, 7584, 6446, 8591, 7384, 7535, 7448, 9137 and 9419 and local fixes on top. main carries many of those
commits as ancestors without their content, so the merge was made against main's tree, not its history: nothing
main dropped is dropped again here.

Resolved by hand:
- d3d12_xs_device.cpp and frame_pacer.h: the stack's Xbox-ABI layer, plus main's uncapped pacer and its two new
  registration hooks (set_placed_at_va_pages_hook is called before slot 133's handler; the console descriptor
  heap handler is stored but slot 14 still uses the title-backed heaps of old PR 7021).
- xmem.cpp, xmem_test.cpp: the stack's run-mapped physical pages. main's commit-on-touch xmem with the two
  view-protection fixes it lost (7e8e3c1db, 954fcb106) boots to 50,468 pipelines and then fails a submit with an
  unknown resource, so it is not used here yet.
- acphal.cpp, acphal_test.cpp, vulkan_replay.h (acceleration structure copy), README: main's.
- CMakeLists.txt, build_runtime.ps1, d3d12_com.cpp, d3d12_vulkan_device.cpp, shader_library.h, docs: both sides.

Measured (Linux, Wine 11.21 staging, RTX 5070 Ti, driver 615.78.08, clang-cl 22.1.8 + xwin, own 1.0.2.1 copy,
network off, LEONIDA_GRAPHICS_STAGE_LAYOUT=1, 300 s): 50,470 pipeline states created, 197,998 ExecuteCommandLists
with none failed, 148,467 DrawInstanced, 99,008 PresentX.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
2026-11-23 20:42:04 -06:00
584b2679ae make_game, progress_dashboard: name this repository, not the private original
ensure_submodule() told a user with a ZIP download to
git clone https://github.com/ItsNotRexed/Leonida, which is private since
23 November 2026, and progress_dashboard.py --github read that repository by
default, so its pull-request, CI and coordination panels came back empty.

Both now name ubiquitarianism/leonida, as the README's clone command does.
Two tests tie the hint and DEFAULT_REPO to that README line, so a later move
fails a test instead of a user.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit a837d9a616)
2026-11-23 21:27:53 -05:00
e6ca5cb29e Merge pull request #19 from moffington/contrib/pipeline-library-upstream
Add slot-67 pipeline-library shader build and runtime loading
2026-11-23 21:27:26 -05:00
642880a217 shaders: translate pipeline library in parallel and align clash/doc details 2026-11-23 21:20:34 -05:00
dfd239266f make_game, first_light: a vk_pipeline_check or vk_harness older than its sources is rebuilt or reported, not reused silently 2026-11-24 07:35:50 +05:30
b556acb19a fix(linux): name a version probe file whose name differs only in case
On a case-sensitive file system a package copied with its names changed
in case (microsoftgame.config) was reported as "Missing
MicrosoftGame.Config", with no hint why. The probe now names the
variant it found and says the build opens the package's files by their
exact names. It renames and case-folds nothing; on a case-insensitive
file system the exact name opens and the branch is never reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:51:04 -05:00
fca3be703c fix(linux): find a versioned llvm-mc and give Linux install hints
Debian and Ubuntu's llvm-<N> packages install llvm-mc only as llvm-mc-<N>
and /usr/lib/llvm-<N>/bin/llvm-mc. With LLVM_MC unset, the build looked
for the plain name alone and stopped with Windows advice
(scripts\build_llvm_mc.ps1, WSL), while tests/conftest.py already found
the versioned install, so the pytest suites passed where make_game.py
failed.

mc_command() now keeps the plain llvm-mc when it is on PATH (the name a
work folder's disassembly record holds) and otherwise takes the newest
versioned install, by version number. install_hint() gives each OS its
own advice; the preflight, shader_disasm.py and not_found() use it, and
the SPIRV-Tools hint names the distribution package off Windows and macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:51:04 -05:00
ee2b087b66 shaders: add library_shaders build stage and guard NONE compute states
Add the build-side pipeline-library translation stage to make_game.py on top of the .state emission already merged in tools/shader_library.py, and fix a TypeError when a compute pipeline record has a NONE (0xFFFFFFFF) state index.

- tools/shader_library.py: filter NONE program/state indices when building cs_state so records without a state blob do not crash with TypeError.
- make_game.py: add LIBRARY_ARCHIVE, LIBRARY_TOOLS, library_settings(), and library_shaders() to the shaders() stage (unpacking cs programs with --disasm and --carve, translating via rdna2spirv.py, validating fspx_key_clash against non-dict/unreadable indexes, cleaning stale unpacked artifacts, and writing library_build.json).
- docs/fspx.md, docs/shader_library.md: document library_shaders(), .state emission, and runtime loading of library/index.json.
- tests/test_shader_library.py, tests/test_library_shaders_stage.py: add NONE-state cleanup and shared-code/distinct-state regression tests plus full stage reuse, invalidation, stale-artifact cleanup, clash, malformed-index, and real-tool tests.
2026-11-23 20:38:06 -05:00
d083a2cc37 Make main's tests green: 12 test files that drifted from the code (#9896)
Twelve test files failed on main at 2d53a8055 (CI's check and semantic-tests steps, run locally): most are a test
and the code it checks changed by different pull requests in the same merge round. Each fix below is either taken
from a closed pull request that already had it, or restores what an earlier merged change intended.

From closed pull requests:
- test_make_game_resume: FakeProc gets poll(), which translate() now calls (#7018)
- test_make_game_empty_translation: the Exited stub gets poll() and the failed-shard path is checked (#7214)
- test_shader_checks: stub table_fetch_test in the Wave64Checks harness and count it (#7433)
- test_runtime_paths: runtime.yml's path filter lists tools/replace_retry.py, which rdna2spirv.py imports (#7029)
- test_psin_names: patch the same_report_path helpers that report_paths now calls (#8719)
- test_report_source_collision: the fixture is a real Bink 2 header; bink_index refuses other files (#7408)
- test_missing_input_exit_codes: tile_probe checks its inputs before it asks for numpy (#4771)

Restored:
- merge_check: a failed `git show` is an error again (5b88d58); 21016cf brought back the lenient read that
  treated it as a new file, while new files are already left out when the diff is read
- rpf_probe: a symlinked --out updates its target again (44d3595); 55d21cc's staged write replaced the link

Updated to the code:
- test_shader_stage_resume: TRANSLATION_SOURCES lists fssm_unpack.py and shader_stage_manifest.py, which the
  translator imports; existing work folders translate once more after this
- test_tool_stdout_encoding: the 15 programs merged without the stdout guard get the same block as the others
- test_rdna2spirv_decode: drop the test of decode_any_format, which SHADER-849 replaced with the table decode
  that tests/semantic/test_format_decode_table.py checks

Co-authored-by: jewmaster1337 <102986566+jewmaster1337@users.noreply.github.com>
Co-authored-by: TanmaySatyam <248538550+TanmaySatyam@users.noreply.github.com>
Co-authored-by: evilclanker9000 <45567075+evilclanker9000@users.noreply.github.com>
Co-authored-by: slint6614-dev <359954236+slint6614-dev@users.noreply.github.com>
Co-authored-by: BlackNife <108077267+Poussistar@users.noreply.github.com>
Co-authored-by: fiestorra <65175643+fiestorra@users.noreply.github.com>
Co-authored-by: fearkov <289226582+fearkov@users.noreply.github.com>
Co-authored-by: DoubleD17 <48109637+DoubleD17@users.noreply.github.com>
2026-11-24 00:21:26 +01:00
a2c2ba8788 Merge pull request #4092 from ray3242/devin/1795389450-pipeline-crash-bisect
make_game pipelines: bisect crashes to the module and record its SPIR-V hash (TEST-895)
2026-11-24 00:18:42 +01:00
01cb5dcbce Merge remote-tracking branch 'origin/pr/8998' 2026-11-23 17:40:54 -05:00
254f9df086 Merge PR #9553 2026-11-23 17:07:22 -05:00
b2ed1d22cd Merge PR #9550 2026-11-23 17:07:16 -05:00
cc495ee436 Rebuild an FSPX cache without a compute lookup key 2026-11-24 02:56:33 +05:30
fdc026a35e Accept BOM-marked indexes in the pipeline stage 2026-11-24 02:56:33 +05:30
884acda9a1 make_game: find packaged files at the last discovery level 2026-11-23 22:18:55 +01:00
5a186e9b2e make_game: an empty --game/--out/--work/--runtime-build is a usage error, not 'use the default'
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 20:56:13 +01:00
12a9e7bc33 pipelines: warn instead of raising when the crash report cannot be written 2026-11-23 12:41:18 -06:00
b487b6d8cc Merge branch 'pr7746' into ladder-frame
# Conflicts:
#	make_game.py
#	runtime/src/shader_library.h
#	runtime/test/shader_library_test.cpp
2026-11-23 19:39:53 +01:00
5caef48a19 Merge branch 'pr7111' into ladder-frame
# Conflicts:
#	docs/runtime_imports.md
#	runtime/CMakeLists.txt
2026-11-23 19:38:48 +01:00
6dda0630bd make_game: --mesh-compute on by itself on Intel's Windows Vulkan driver, whose mesh draws crash (BUILD-2202) (#6789)
Squash-merged after diff review of PR #6789
2026-11-23 12:33:00 -06:00
7ca3a16b19 pipelines: keep the crash report on give-up paths; rebase onto current main 2026-11-23 12:17:54 -06:00
b36eff2cc2 make_game pipelines: record crashed modules' SPIR-V hashes on the new recovery path 2026-11-23 12:14:50 -06:00
bc5fc47b9c make_game: rebuild exe_shaders cache when cached index has 0 translated programs 2026-11-23 18:38:46 +01:00
ab03d8dd12 make_game, runtime: translate and load game_scarlett_master.exe embedded shaders 2026-11-23 18:28:36 +01:00
b93ffa5617 shaders: translate the pipeline library's compute pipelines, which the executable creates with slot 67 (RT-5)
The retail executable calls Xbox device slot 67 (DeserializeComputePipelineStateX) itself during boot, and every
call fails with "no translated compute shader": the build only translates the FidelityFX DLL's 29 FSPX programs.
The programs come from the pipeline library in shaders.rpf (docs/shader_library.md), which the title reads through
DirectStorage zlib requests: a compute record's state blob, blob, program and layout blob are FSPX kinds 0, 1, 6
and 7, the four pairs of the slot-67 description.

- tools/shader_library.py writes each compute program's record state blob as fspx/<name>.state, so the index gets
  fspx_state_sha256 (slot 67 always passes kind 0). In 1.0.2.1 each of the 2,684 compute programs has one.
- make_game.py's shaders stage gets library_shaders(): shader_library.py --stages cs --disasm --carve into
  <work>/shaders/library, rdna2spirv.py into <work>/shaders/spirv/library, with the stage's wave64 and fallback
  flags, the FSPX step's key-clash check and its own library_build.json for reuse.
- ShaderLibrary::load also reads <dir>/library/index.json; its entries are found by the same two keys.

Tests: test_library_shaders_stage.py (tool calls, reuse, invalidation, empty index, key clash),
test_shader_library.py (.state contents and both keys), shader_library_test (library entries found by code and
state key, a broken or missing index leaves the others).
2026-11-23 17:59:53 +01:00
e76640014a docs: the AMD driver took 34 minutes on LeafRehydration's dispatch-loop module; the current translation compiles in 3 s (SHADER-995) (#6739)
Squash-merged after diff review of PR #6739
2026-11-23 10:49:09 -06:00
86a7807dd4 Barycentric fallback on by itself on AMD's Windows driver for gfx90c (#5933) (#6828)
Squash-merged after diff review of PR #6828
2026-11-23 10:42:42 -06:00
9f669b362f Reject directories at runtime installation file paths (#6734)
Squash-merged after diff review of PR #6734 - make_game: Reject directories at runtime installation file paths
2026-11-23 10:05:10 -06:00