Commit Graph

29 Commits

Author SHA1 Message Date
45c15d0528 Merge upstream/main into fix/shader-disasm-stage-cleanup 2026-11-30 13:39:37 +03:00
eeb967c89e shader_disasm: restore write mode before unlink on replace failure and publish mode (SHADER-DISASM-STAGE-CLEANUP)
Apply published_mode(out_file) to temporary listing before atomic replacement,
and restore write permission (0o600) before unlinking in finally block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.

agent: yes
AI-assisted: yes
2026-11-29 18:24:20 +03:00
18e0304d57 shader_disasm: use a per-run failed list in main() instead of shared FAILED 2026-11-29 09:45:11 +00:00
15c34d7971 tools: add auto fallback to python disassembler in shader_disasm and shader_library 2026-11-27 14:01:03 +01:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06:00
aadfda67e5 Decode FSSM listings at the compiled wave size 2026-11-24 02:56:33 +05:30
00fefcaef9 Merge pull request #4395 from Maxime Mansiet
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:14:19 -05:00
95969c87c7 Merge pull request #4377 from Luis Baker
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:14:10 -05:00
8d88450ee2 Merge pull request #3960 from Wasler
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:56 -05:00
40e540733e shader_disasm: decode llvm-mc's output with errors="replace"
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-23 02:02:23 +01:00
e09ba00074 shader_disasm: refuse a listing that would overwrite its input
A planned <out>/<stem>.s that names an input (a foo.s given with --out at its
own folder, the default ../disasm of a file already in disasm/, FOO.S where
case is ignored, a hard link) replaced the input with its own listing, or with
--skip-existing was counted as a finished listing. A folder where a listing
goes failed per shader inside the worker pool. Both are now one ERROR line,
exit 1, before llvm-mc is probed or --out is created. Path comparison reuses
tools/report_paths.py.

Tests: 7 new cases in tests/test_shader_disasm.py (26 OK; 6 of them fail with
main's tool). Synthetic inputs only, no game files. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:52:02 +01:00
b23779d6a9 tests: pass errors=replace to subprocess pipes capturing python -I tools 2026-11-23 00:42:37 +02:00
fa33dd1616 Merge pull request #3647 from Kam471 2026-11-22 17:03:11 -05:00
0fa5d0e25c Merge pull request #3402 from kapitche 2026-11-22 17:01:52 -05:00
d1490e359e BUILD-1046: missing inputs exit 2; image_query_probe help before oracle
Eleven tools treated a nonexistent input folder as a failed run (1). They now print one ERROR line and return 2, while real read failures keep exit 1. image_query_probe imports the hardware oracle only for a GPU run, so --help stays prompt. A table-driven subprocess test covers all eleven; existing expectations are updated.
2026-11-22 21:11:07 +00:00
2c9b8620bd shader_disasm: end the code range before a trailing constant-data block
Blobs can end with s_endpgm, a dword count N, N dwords of data and a closing s_endpgm. The data was disassembled as code, so llvm-mc reported invalid words.
2026-11-22 15:25:17 -05:00
af571fc8fb Merge pull request #3198 from bobcatchris 2026-11-22 15:15:38 -05:00
853bbd0a6b Merge pull request #3024 from Vonsek 2026-11-22 15:14:08 -05:00
abf5a5602c shader_disasm: prune only after the decode proved it works 2026-11-22 14:01:33 -06:00
63ad8a9d3d tests: do not pin the folder listing to the pre-listing output 2026-11-22 13:59:00 -06:00
2f23d6b8a5 shader_disasm: drop listings of shaders the folder no longer has 2026-11-22 13:40:09 -06:00
6f898a62dc fix(build): align fallback shader terminator scans
A terminator byte pattern spanning metadata words can look like a clean one-instruction shader. Search for a dword-aligned instruction before decoding the fallback range.
2026-11-22 20:07:35 +01:00
6b783318b3 BUILD-667: resume interrupted shader disassembly
Depends on: #2031. AI-assisted.
2026-11-22 18:24:00 +01:00
c7408a1f7e Keep stale shader files out of resumed builds
Select each stage's inputs from its producer index and refresh downstream
stages when a saved cache contains obsolete shader names.
2026-11-22 23:35:45 +08:00
613c9866c9 shader_disasm.py: report an --out that is a file as one ERROR line
os.makedirs raised FileExistsError with a traceback when --out named an
existing file. Report it before any work and leave the file alone.
Synthetic regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:36:15 +03:00
2da357da8c shader_disasm: filter regular FSSM files before applying the limit 2026-11-22 04:45:01 -03:00
6e830f5641 shader_disasm.py: an llvm-mc error is a failure, and a run with no listings exits 1
disasm() ignored llvm-mc's exit status, so a shader whose disassembly stopped
partway (llvm-mc printed some lines, then exited 1) was written out and
counted as clean. A nonzero exit now discards the output and the shader is
reported as failed, with llvm-mc's error.

A run in which no shader produced a listing (every one "no s_endpgm") exited
0, and make_game.py writes disasm.done on exit 0. It now exits 1 naming the
source folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:16:30 +01:00
8cce07b917 shader_disasm.py: scan blobs too short for the header instead of crashing the run
A blob shorter than 0xC4 bytes made code_range read the code offset past the end and raise struct.error. The
error came out of ex.map and stopped the whole run, so make_game.py failed at the same blob on every rerun.
Such a blob now goes to the s_endpgm scan like any other header miss and is counted as "scan failed" or
"no s_endpgm".

--jobs and --limit now must be at least 1 (--jobs 0 made ThreadPoolExecutor raise, --limit -1 dropped the
last file). A source with no .fssm files, or one that doesn't exist, ends with an ERROR line instead of an
IndexError or FileNotFoundError traceback.

Tests: tests/test_shader_disasm.py, with a fake llvm-mc (no GPU, no game data).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:48:43 +03:00
e64ab9d3cc Shaders: fail when llvm-mc can't disassemble; accept a WSL command in LLVM_MC
The official Windows LLVM build ships no llvm-mc.exe and has no AMDGPU
target, which is what issue #7 ran into. A tool that existed but could
not disassemble produced empty output, so shader_disasm.py counted 0
invalid words, wrote an empty .s per shader and reported every one as
"clean"; make_game.py then translated nothing.

Probe one s_endpgm before the run and stop with the tool's own error.
Empty per-shader output is now "failed" and exits 1, never "clean".
LLVM_MC may be a whole command line, so Windows can call WSL's llvm-mc:

    set LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc

make_game.py accepts the same form in preflight and need(); README and
design.md now state the real requirement. New tests cover a missing
tool, a missing AMDGPU target, empty output and the success path.
2026-11-21 15:39:35 +00:00