Commit Graph

29 Commits

Author SHA1 Message Date
3e4b15ccd3 Merge pull request #834 from trigger337/fix/world-names-stage-cleanup
world_names: restore write mode before unlink on replace failure and publish mode (WORLD-NAMES-STAGE-CLEANUP)
2026-11-29 19:36:43 +01: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
b87abdef57 Merge mandy's main into port/d3d12-nvidia
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>
2026-11-27 17:50:37 -05:00
3d62a31302 PR #834: world_names: restore write mode before unlink on replace failure and publish mode (WORLD-NAMES-STAGE-CLEANUP)
From https://github.com/ProjectLeonida/mandy/pull/834 (head 2cb6ed8821), applied as a reviewed patch.

Co-authored-by: trigger337 <trigger337@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 15:42:17 -05:00
04b6b2ee4a tests: assert the PermissionError filename as OSError renders it (TEST-WIN-PERMERR-REPR)
Three unreadable-directory tests compared the plain path against the
captured stderr, but the tools print str(exc), whose .filename is rendered
with repr(): quoted, backslashes doubled. On Windows each file failed that
one assertion; on Linux the path never contains backslashes so they passed.
The assertions now compare repr(blocked), the exact rendering under test.

The finding is GTAVIB4GTAVI's (coordination issue #14, 23:34:10Z).

AI-assisted.
2026-11-24 23:56:11 +00:00
2cb6ed8821 world_names: restore write mode before unlink on replace failure and publish mode (WORLD-NAMES-STAGE-CLEANUP)
When writing dictionary JSON atomically in _write_json, apply published_mode
to the staged file and reset os.chmod to 0o600 before exiting TemporaryDirectory
if os.replace fails, ensuring cleanup does not fail with PermissionError on
Windows when replacing a read-only file.

agent: yes
AI-assisted: yes
2026-11-24 17:22:00 +03:00
feb51c6cfa Require matching XML end tags when extracting world names 2026-11-23 20:55:18 +01:00
c25b9f280e world_names: join parent maps across input reports (#6766)
Squash-merged after diff review of PR #6766 - world_names: join parent maps across input reports
2026-11-23 10:02:28 -06:00
369a76fa9d Merge pull request #4627 from Teerth1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:36 -05:00
6b907a294d Merge pull request #4471 from Leo Leahy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:02 -05:00
bdc5c3a348 world_names: skip overflowing archetype counts 2026-11-22 22:24:45 -05:00
63e1f44deb world_names: refuse build --out overwriting an input 2026-11-22 22:35:56 -03:00
5130144867 Fail world name builds on incomplete manifest discovery 2026-11-23 00:25:40 +01:00
1476045e51 Merge pull request #3133 from Marco Luzzaro 2026-11-22 15:15:01 -05:00
ad1e9aa297 BUILD-906: reject unrelated archetype reports 2026-11-22 20:28:33 +01:00
305b863c68 world_names: skip a name with a lone surrogate instead of aborting the build 2026-11-22 14:19:34 -05:00
4c44d9ef67 fix(tools): count parent-map links only to map rows
Resource tables can contain non-map names, which inflated the link totals even when the target map was absent. Build the name set and the report from the same map rows.
2026-11-22 17:15:28 +01:00
0a6ac14b72 world_names test: check the overwrite diagnostic for the path as printed
857b450b changed the check to repr(source) to match the old !r message,
while #1692 dropped !r from tools/world_names.py so Windows paths match.
Together they fail on every OS: the message has no quotes, so the repr
form is never in it. Check for "would overwrite input <path>" instead.
2026-11-22 17:31:31 +03:00
857b450bce world_names test: match the escaped overwrite diagnostic
AI-assisted with DeepSeek V4 Pro. Verified with synthetic tests on macOS arm64.
2026-11-22 13:58:40 +01:00
2afc15de85 world_names.py: refuse a resolve report that aliases an input 2026-11-22 13:20:10 +01:00
6f83550233 world_names.py: diagnose malformed dictionary tables 2026-11-22 12:16:25 +01:00
4c85973eea world_names: isolate JSON report staging files 2026-11-22 05:05:17 -03:00
83d9537a70 Merge pull request #986 from bbareth 2026-11-22 01:08:10 -05:00
2067e91a49 world_names.py: an unterminated comment ends at the next XML declaration; strict XML unescaping (review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:41:15 +01:00
57540ad2a1 Merge pull request #986 from bbareth 2026-11-22 00:33:24 -05:00
8e60787e78 world_names.py: XML names are unescaped, and names inside comments are ignored
add_xml() matched <filename> and <name> elements with regexes on the raw
text, so an escaped name was hashed as written ("A&amp;B", not "A&B") and an
element inside an XML comment was added as a real name. Comments are now
removed first (CDATA and processing instructions are kept), and values are
unescaped with html.unescape, which never raises on a stray reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:29:34 +01:00
8fa6b89f4c World names: whole-archive coverage, --archetypes-out and --rpf9-names
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>
2026-11-22 00:10:01 -05:00
5fd107b18a world_names.py: reject an unrecognized map report 2026-11-22 00:16:37 +01:00
5bc48f20b7 world_names: resolve placement/archetype hashes with 32-bit joaat and Murmur3-64
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.
2026-11-21 22:36:32 +00:00