Commit Graph

25 Commits

Author SHA1 Message Date
ec9845c3d1 shader_profile: ask report_paths for the report-path guard
`same_output_path` was a second derivation of `report_paths.same_report_path`, which CONTRIBUTING.md asks a report writer to call, and it missed the helper's folding-volume probe (vfat/exFAT/CIFS). The name stays as a one-line delegation because `tests/test_shader_profile.py` calls it by name.
2026-12-01 19:44:40 -05:00
00131bb85e main keeps its own runtime, tools and tests; the branch's variants stay on port/d3d12-nvidia
After the merge the tree held this branch's older states of files main maintains. Run against main's code,
tests/test_acphal_abi.py and 11 of the 15 translator tests that differed failed, and the C++ runtime would have
been built from two generations of its sources. So that the merge cannot break what main builds and tests:

- runtime/ is main's, file for file (68 files only this branch had are not carried over);
- every file under tools/, tests/ and docs/ that both sides have is main's (80 files);
- ten translator tests only this branch has, which test rules main's translator does not have, and their
  fixtures are left out.

What main gains: d3d12/ (the Rust D3D12 runtime), its launchers and helpers (Launcher.bat, scripts/play*.ps1,
play-linux.sh, port_ctl.py, smooth-motion.ps1, fetch_vkd3d_proton.py, sync_victory.py), mods/example_lua, eleven
notes under docs/, seven tools and the tests that pass with main's code, the README's sections and credits, and
the "Runtime traps" section of AGENTS.md. Everything left out here is on the branch port/d3d12-nvidia.

Checked: compileall; make_game.py --help; check_no_game_data.py over every file this adds to main; the
line-ending, docs-encoding, CI-registration and docs tests; each test file that differs from main, on its own.
Not run: the whole translator suite, the C++ build, cargo over d3d12/ after the merge (d3d12/ is byte for byte the
branch's), CI.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:58:38 -05:00
a12a845a15 PR #1172: shader_profile: ask report_paths for the report-path guard (SHADER-PROFILE-SHARED-REPORT-PATH)
From https://github.com/ProjectLeonida/mandy/pull/1172 (head 018df194ee6a), applied as a reviewed patch.

Co-authored-by: breachato <breachato@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 15:42:20 -05:00
cddee3f7d2 Count invalid words declared in disassembly headers 2026-11-24 02:56:34 +05:30
d239fd8556 tools: accept UTF-8 BOM JSON inputs in ten utilities (#6779)
Squash-merged after diff review of PR #6779 - tools: fix BOM-prefixed JSON inputs in 10 utilities (batch 01)
2026-11-23 09:56:38 -06:00
108c36ef75 shader_profile: report instruction categories by stage (#6856)
Squash-merged after diff review of PR #6856 - shader_profile: report instruction categories by stage
2026-11-23 09:54:03 -06:00
3218515c47 Merge pull request #3269 from shdann 2026-11-22 15:16:21 -05:00
d03f9e63eb shader_profile: report unreadable listings cleanly 2026-11-22 22:57:19 +03:00
3761493209 fix(tools): stabilize shader profile rankings on ties
A filesystem enumeration can change which tied mnemonics appear in the top-12 summary and produce unrelated differences in the JSON report.
2026-11-22 17:55:30 +01:00
4e3a62e7d5 Merge pull request #1887 from lumenpearson 2026-11-22 10:39:11 -05:00
86aa9398e5 fix(tools): protect the shader carve index in shader_profile 2026-11-22 17:50:24 +03:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
e7aa5afd81 shader_profile: refuse report paths that overwrite input disassembly files 2026-11-22 17:42:12 +05:30
6e4da8929c Merge pull request #1454 from Rafael 2026-11-22 06:38:08 -05:00
b093d45d08 shader_profile: take each shader's stage from the carve index
The per-stage report took the stage from the file name's first two characters before an
underscore, but most corpus names carry no stage prefix, so on my 26,503-shader corpus 25,040
(94%) landed under "?" (ps 1,228, vs 225, ms 10, cs 0). shader_carve.py's index.json next to the
disasm folder has every container's stage from its program header, as rdna2spirv.stage_of reads
it; stage_map() now loads it and the name prefix is only the fallback for shaders it doesn't list
(or when there is no readable index).

Real data (counts only), the same 26,503 shaders, main -> this change:
? 25,040 -> 0, ps 1,228 -> 12,101, ms 10 -> 9,282, cs 0 -> 2,689, vs 225 -> 2,236, gs 0 -> 195.

Tests: test_cli_takes_the_stage_from_the_carve_index (main: every listed shader without a prefix
is "?", and a name prefix wins over the index).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:29:04 -03:00
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
ed572ebbd7 shader_profile: skip non-file .s entries 2026-11-22 04:32:14 -03:00
ae51e74ffb Profile LLVM warning words at their reported columns 2026-11-21 19:08:00 -07:00
906dd402c3 shader_profile.py: a bad source or --out is one line, and --out is checked before the scan
A missing source or a file given as one ended in a traceback from
os.listdir. An --out in a folder that doesn't exist (or that is a
folder itself) failed only after the whole corpus had been profiled,
again as a traceback. The source and the output folder are now checked
first, and a failed write is caught; each case prints one line naming
the path and exits 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:51:41 +01:00
591ecf66b9 shader_profile.py: use the same instruction counts in both reports 2026-11-22 00:13:17 +01:00
38f17196d3 Merge pull request #282 from Claude
# Conflicts:
#	tools/shader_profile.py
2026-11-21 17:38:22 -05:00
46d3093d61 shader_profile: report per-stage register pressure; add --per-shader
profile_shader() and register_footprint() were only called from the tests.
main() now runs profile_shader() on every shader and adds a "registers"
section to profile.json: per stage, the max and mean VGPR/SGPR count and a
VGPR histogram (<=32/64/128/256). --per-shader also lists each shader's
instruction count and VGPR/SGPR footprint. Existing output is unchanged.

Tested with hand-written disassembly only (tests/test_shader_profile.py).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011jW1LkcxdgoMR14Ng7tzCo
2026-11-21 22:19:36 +00:00
f6bfb13c53 Write valid JSON for shader profiles with no memory operations 2026-11-21 14:11:21 -07:00
85842cc574 test(tools): add test_shader_profile.py and opcode/register profiling in shader_profile.py 2026-11-21 19:02:51 +01:00
db0dc8bd5e Initial commit: Leonida, build-it-yourself PC port groundwork
Shader pipeline (carve, FSSM unpack, gfx1013 disassembly, RDNA2 to SPIR-V),
asset export via rpf9-explorer's Core (submodule), PE loader and shim
skeleton, and make_game.py, which builds from the user's own copy of the game.
No game data, keys or executables are included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:22:16 -05:00