Commit Graph

36 Commits

Author SHA1 Message Date
e5042dd503 Merge pull request #838 from trigger337/fix/world-lights-stage-cleanup
world_lights_paths: restore write mode before unlink on replace failure and publish mode (WORLD-LIGHTS-STAGE-CLEANUP)
2026-11-29 19:59:29 +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
efba22c1ce PR #838: world_lights_paths: restore write mode before unlink on replace failure and publish mode (WORLD-LIGHTS-STAGE-CLEANUP)
From https://github.com/ProjectLeonida/mandy/pull/838 (head 09bbad3cca), 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:48:40 -05:00
09bbad3cca world_lights_paths: restore write mode before unlink on replace failure and publish mode (WORLD-LIGHTS-STAGE-CLEANUP)
Apply published_mode to staged .partial file and reset os.chmod to 0o600
before os.remove on replace failure or write error, ensuring temporary file
cleanup does not fail with PermissionError on Windows.

agent: yes
AI-assisted: yes
2026-11-24 17:25:12 +03:00
0cbc40239b world_lights_paths: read pool references through world_index.split_pointer
Meta.ref took the block number from bits 0..11 and refused any value with
bits 12-19 set as a pool reference, so a pointer to block 4,096 or above
fell through to the system-pointer path. Those bits are the high bits of the
20-bit block number. The guard did not screen system pointers either: with
fewer than 4,096 blocks, a value with bits 12-19 set has a 20-bit block number
above the block count, so it still reaches the system-pointer path.

Over levels.rpf (188,449 0x7a resources, 8,576 with lights) the summary is
byte-identical with the old and the new decoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:49:18 -05:00
e59697a907 world_lights_paths: refuse malformed --entities rows before the scan (#3151)
Squash-merged after diff review of PR #3151
2026-11-23 09:49:55 -06:00
07f1d7e8d8 world_lights_paths: compare duplicate light definitions by value (#6887)
Squash-merged after diff review of PR #6887 - world_lights_paths: compare duplicate light definitions by value
2026-11-23 09:46:27 -06:00
2dd8795ad8 navmesh_index/world_lights_paths input guards; bcpack_tool in docs; design.md f16-interp row (#6916)
Squash-merged after diff review of PR #6916 - navmesh_index/world_lights_paths input guards; bcpack_tool in docs; design.md f16-interp row
2026-11-23 09:36:24 -06:00
e35d50072d Merge pull request #4429 from Silent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:14:39 -05:00
1486ca2e82 Merge pull request #2427 from bbareth
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:37 -05:00
3e7d9b0bb1 world_lights_paths: the --out summary write reports failures as one line
The input half of main answers with one ERROR line, but the summary write sat
after the try/except, so --out naming a directory (or an unwritable/mid-full
target) left an IsADirectoryError/PermissionError traceback. Wrap the write in
the OSError convention (one ERROR line, exit 2).
2026-11-22 22:24:21 -03:00
dca9f87464 Merge pull request #3698 from Leo Leahy 2026-11-22 17:03:28 -05:00
78b5113371 Merge upstream main and preserve both changes
Conflict resolution AI-assisted with DeepSeek V4 Pro. Focused synthetic tests passed on macOS arm64.
2026-11-22 22:57:17 +01:00
5757f357fe world_lights_paths: guard None entries in graph_stats first_link_monotonic check 2026-11-22 18:23:00 -03:00
ef7ae69372 Merge pull request #3079 from tupacfan04 2026-11-22 15:14:38 -05:00
34d184980d Merge pull request #3056 from Marco Luzzaro 2026-11-22 15:14:24 -05:00
ee88d13315 Merge pull request #2918 from Vonsek 2026-11-22 15:13:10 -05:00
b7d0d3a4c9 Merge pull request #2553 from Vonsek 2026-11-22 15:11:06 -05:00
008134761c world_lights_paths: remove the staged report when the replace fails 2026-11-22 13:22:53 -06:00
5bef2b3c68 world_lights_paths: stage the lights report so a failed run keeps the old one 2026-11-22 13:19:10 -06:00
445724fa71 world_lights_paths: reject a negative scan start 2026-11-22 20:14:15 +01:00
1b4346cf36 fix(assets): normalize placed light rotations
The light transform expects a unit quaternion. Normalize the stored components so they represent the same rotation as the associated world geometry.
2026-11-22 19:43:00 +01:00
465eabfb39 Merge pull request #2388 from bbareth 2026-11-22 13:14:32 -05:00
3af42c6192 merge: preserve upstream changes alongside the asset fix 2026-11-22 19:08:54 +01:00
e6af0a0931 fix(tools): preserve light positions from posn-only schemas
The decoder reflected posn but both light placement paths treated a missing position120 as a zero vector.
2026-11-22 18:28:05 +01:00
73c60c5ef0 world_lights_paths: protect archive and entity inputs from reports 2026-11-22 18:01:36 +01:00
4bccf06826 world_lights_paths: report medians for even-sized samples 2026-11-22 17:54:01 +01:00
fc9da7aff3 Merge pull request #2107 from Vonsek 2026-11-22 11:41:51 -05:00
88eb186603 Merge pull request #2052 from Nethmina Yasas 2026-11-22 11:41:14 -05:00
884688e93a tests: cover a valid --limit on the world lights tool 2026-11-22 21:33:55 +05:30
ce580f7f80 fix(tools): preserve zero scales when placing world lights
The existing unit-scale fallback also caught explicit zeroes, which displaced lights from their entity origin. Share the absent-scale handling between both sources of light placements.
2026-11-22 16:58:23 +01:00
b5b72e4a7a tests: cover non-positive --limit on the world lights tool
The synthetic CLI test asserts exit code 2 and the one-line error text.
2026-11-22 21:07:19 +05:30
aa4351f3fa world_lights_paths: detect case-only report aliases before scanning 2026-11-22 12:09:42 -03:00
dd12fb296a world_lights_paths: reject colliding light and summary reports 2026-11-22 11:26:04 -03:00
840a6e3e32 world_lights_paths: map lights and the vehicle lane graph in levels.rpf (ASSET-102)
New stdlib tool on top of world_census.assemble and the world_index header
readers. Every field is read by member hash from each 0x7a resource's own
schema.

Lights: every CExtensionDefLightEffect reachable from the extensions list
of an archetype, interior archetype or entity, and its CLightAttrDef
lists. Counts per type, owner and resource kind, value ranges and checks.
With --entities (world_index.py --entities-out rows) archetype lights are
placed in world space through each map entity's transform, the same one
world_build.py --placements uses; --lights-out writes them (local only).

Lane graph: path nodes, links (lanes, flags, length) and junctions
(entrances, turns, traffic-light phases), with connectivity measured.

Full levels.rpf: 280,105 lights (450,195 placed through map entities),
63,808 nodes, 145,518 links, 1,546 junctions (369 signalised). The lane
graph equals SixNG's on every count; all 5,285 lights SixNG lacks come
from pool references at offsets 0x500..0x6ff that it reads as pointers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:52:58 +00:00