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>
Brings the D3D12 runtime branch (d3d12/, its launcher scripts and notes, and the pull requests reviewed and applied
on it) together with mandy's main.
Conflicts (67 files, none under d3d12/): docs/, make_game.py, runtime/, scripts/build_runtime.ps1, tests/ and
tools/. Every one takes main's side: main is where that code is maintained, and this branch's copies were older
states of the same files or the same pull requests in another form. tests/test_fspx_unpack.py is main's too, as it
tests main's tools/fspx_unpack.py. Nothing under d3d12/ is changed by the merge.
Checked before pushing: python -m compileall over make_game.py, tools and tests; make_game.py --help;
scripts/check_no_game_data.py over the files this adds to main; tests/test_text_write_line_endings.py. The
translator suite, the C++ runtime build and CI have not run on the result.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Apply published_mode(destination) in _staged_entity_report 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
A 0DRP/PSIN pool pointer keeps the 1-based block number in its low 20 bits
and the byte offset above (docs/psin.md, docs/ped_catalogues.md, psin_data).
instance_lists and world_interior_names masked 12 bits, as docs/world.md
said, so a block number of 4,096 or more would have been read as a wrong block.
world_index.split_pointer is now the one decoder for the three tools, and
docs/world.md gives the 20-bit form. Over the 0x7a resources of levels.rpf,
story000.rpf, shared_minigame000.rpf and packs.rpf (232,846), the most blocks
one has is 1,760, and every non-null 0x52 array and 0x42 string pointer has
bits 12-19 at zero, so the counts the tools report don't change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
os.path.normcase folds case only on Windows, so on macOS's default
case-insensitive APFS volume `--out out/R.json --csv out/r.json` passed
_check_report_paths and the CSV replaced the JSON summary. New report paths
now fold case and Unicode normalization when the volume that will hold them
is case-insensitive (pathconf _PC_CASE_SENSITIVE); case-sensitive volumes
keep two distinct reports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scan_rpf appends the next contiguous zlib stream while a 0DRPz resource still needs a continuation
(a large resource keeps its system page in one stream and the rest in the next). The directory
branch of scan_path parsed each carved file alone, so those resources were lost: on a 1.0.2.1
copy, `world_index.py data.rpf` finds 15,768 resources (docs/world.md) and the data.rpf carve
folder found 15,756.
In a carve folder the same rule now applies: a file is joined with the next one when
rpf9_carve.py's index.json shows that stream started at the 16-byte boundary right after it (as
scan_rpf checks in the archive), up to two continuations, within max_inflate. Without an index
the files are parsed one by one, as before. The data.rpf carve folder now gives 15,768.
Tests: a carve folder with a resource split over two files plus a second resource must list the
joined resource once with its full size (fails on main: the map row is missing), and two streams
that weren't contiguous must not be joined.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_world_census, test_bvh_index, test_world_index and
test_audit_shader4_regs call the tools' main(), which prints a JSON summary
or report; run as scripts (as CI does) that is about 280 lines of noise
around the results. A setUpModule per file redirects stdout; the tests that
check the output already redirect it themselves.
An entity block whose start lies past the inflated bytes (for example beyond
--max-inflate) got off = None and was skipped, so its entities were neither
aggregated nor counted as incomplete_entities. They are now reported as
incomplete. The parse_resource docstring describes how collect is used.
Found in review of #954. Whole levels.rpf (1.0.2.1) re-run with this change:
incomplete_entities 0, archetype counts and keys identical to the run
published in docs/world_names.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/world.md and docs/world_names.md said ~96% of archetypeName hashes stay
unresolved. That was a name-source limit of the two sampled windows: the
names are in levels.rpf, and rpf9_names.py already lists them. With its
name.#dr/name.#ft list as the dictionary, 99.85% of the 1,670,435 placement
entities resolve (99.94% with --max-inflate 256 MiB), every match verified by
the entity's 64-bit key.
- world_index.py --archetypes-out writes the aggregate archetype file that
world_names.py resolve --archetypes reads (entity count and 64-bit key per
hash); nothing in the repo produced it before. Entities of a resource that
needs a continuation stream are counted once.
- world_names.py build --rpf9-names reads rpf9_names.py index JSON.
- docs: whole-archive coverage table, the four commands that reproduce it,
and the corrected statements in world.md and docs/README.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scan_rpf() used `min(size, pos + limit) if limit else size`, so
--limit 0 scanned the whole archive. --start and --limit were plain
ints: a negative --limit gave an end before the start (an empty scan
reported as a normal run), a negative --start searched from the top of
the file, and a --start inside the RPF9 header or past the end was used
as given. --start must now be 0 or more and --limit at least 1
(argparse errors), and a --start outside an archive's data area is one
line and exit 2, before any report is written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured on Xbox 1.0.2.1:
- archetypeName, map name and parent are lower-cased joaat.
- per-archetype +0x20 and map +0x10 keys are MurmurHash3 x64 128 low 64 (seed 0).
- +0x08 is a per-entity id, not a per-archetype hash.
A 79,738-name local dictionary resolves 5,107/24,105 distinct
archetype hashes (8,263/203,799 entities) in two bounded windows,
all confirmed by the 64-bit key; one 32-bit-only candidate is
rejected. Map names resolve 5/23,535 and parents 1/2,089.
Adds tools/world_names.py, synthetic tests, world_names.md, and
map_name64 to world_index output.