The tool carried its own `same_output_path` (realpath, normcase, samefile) while it already imported `report_paths.path_key`, so it answered the report-path question two ways; CONTRIBUTING.md asks a report writer to ask `same_report_path` instead of deriving it again. The private copy also missed the helper's folding-volume probe, so on a Linux mount that ignores case (vfat/exFAT/CIFS) `--json R.json` and `--json r.json` were two paths and the second overwrote the first.
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>
The mesh shaders fetch tag 0x27 as BUF_FMT_2_10_10_10_UNORM, map each component by v*2-1, transform xyz
like the normal and cross it with the normal scaled by w. tangent_0x27 is that read, and tangent27_checks
counts per 0x27 slot: unit length, perpendicular to the face normal, along dP/du of each 0x28 stream, and
the side w gives the bitangent. docs/restofworld.md records the counts (levels slot 11: 100% unit, 96.7%
along u of stream 4, w side 99.8%).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where slot 8 holds tag 0x25, each 0x25 slot pairs with the 0x26 slot two below it. skin_checks counts the
skin reading per block: weight sums over the weight slots, descending order, distinct joints among the
non-zero weights, zero weights with index 0, the highest joint used, and the slot-1 colour stream's byte
sum as a control. docs/restofworld.md records the counts (core_restofworld: 95.6% of 212,564 vertices sum
to 255, 99.7% descending, 100% distinct; colour control 0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mesh shaders build a tangent from the bits the normal leaves: with bit 31 set, bits 20-29 are an angle
(v * 2pi/1023 - pi) that turns a basis made from the normal alone; with bit 31 clear, bits 16-22 and 23-29
are a 7-bit octahedral tangent. Bit 30 is the bitangent sign. tangent_0x21 is that decode, and the tool
now counts each tangent against the texture-coordinate gradient dP/du of its triangles, with a randomly
turned tangent as the chance level, and bit 30 against the side of dP/dv. docs/restofworld.md records
the counts on two archive samples.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mesh shaders branch on the sign of the 0x21 word: with bit 31 set they unfold an octahedral normal from
unorm10 x/y in bits 0-9 and 10-19; with it clear, from unorm8 x/y in bytes 0-1. normal_0x21 is that decode,
scored as candidate oct_bit31_10_or_8. Scored by class on sampled blocks, each class matches the face normals
only under its own branch (levels: median 1.00 for both); docs/restofworld.md records the counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
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>
Both tools write their --json report after the whole scan, with no check
on the path. Given one of the input .rpf archives, the archive was
replaced by the report and the run exited 0; a directory, or a file in a
folder that doesn't exist, ended the scan in a traceback.
Now, before the scan, a --json that is a directory or the same file as an
input archive (for vertex_types also one found under an input folder) is
one error line with exit 2. The report's folder is created before
writing, and a write that still fails is one "cannot write" line (the
summary is already on stdout). Same checks as navmesh_decode's
same_report_path/_make_parent and bvh_index's same_output_path.
Synthetic archives only, no game files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stream can hold several 42 40 00 00 blocks back to back, with their
meshlet groups after the whole run in the same order. find_group looked
for block 0's group right after its own last stream, found the next
block's header there and skipped the stream. Walk the run, pair group i
with block i (each pair still has to cover its block densely) and count
blocks left without a group under their own skip reason.
group_edges read each meshlet's first vertex reference and triangle from
the record's u16 fields. parse_group checks those only modulo 2^16, so in a
larger group later meshlets mapped their triangles onto earlier meshlets'
references. Use running sums of vcount and tcount, as parse_group does.
The face-normal (22 decodings x every triangle vertex) and UV mapping tests
made a full-corpus run take days (packs.rpf alone ran for hours). They now
use a fixed sample of up to 256 triangles per block from the tool's seeded
rng, so a rerun gives the same counts; the edge-wrap, per-byte and position
counts stay exhaustive.
data.rpf: 546 s -> 179 s. Same 1,857 blocks; edge-jump counts identical;
s16 mapping spread median 0.105 -> 0.106; face-normal medians within 0.002
(0x21 unorm10_xyz 0.513 both).
AI-assisted (Claude). Tested: python -I tests/test_vertex_types.py (10 pass),
data.rpf before/after on my own copy; no GPU involved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASSET-57 measured the bytes per vertex of each tag on 0x4042 blocks. This adds
tools/vertex_types.py, which takes each block's vertex count and triangles from
the following meshlet group (validated with meshlet_page.parse_group) and
scores candidate decodings with count-only checks:
- 0x28: signed vs unsigned u16 (edge-wrap test), half-float validity, the
+0x7C header word, and how evenly each reading maps onto the positions
- 4-byte tags (0x21, 0x25, 0x26, 0x27): per-byte constancy and edge
smoothness, and face-normal agreement for snorm8, unorm8, 10:10:10,
octahedral and QTangent readings
- 0x42 slot 0: packed position decode (bias +0x60, scale +0x70), with the
+0x6C axis word for model-space face normals
No value leaves the tool; it writes counts only. tests/test_vertex_types.py
builds a synthetic block, group and archive and runs the tool end to end.
AI-assisted (Claude). Tested: python -I tests/test_vertex_types.py (10 pass),
python -m compileall -q make_game.py tools tests; no GPU involved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>