Commit Graph

27 Commits

Author SHA1 Message Date
8b27343069 Merge pull request #816 from trigger337/fix/world-build-stage-cleanup
world_build: restore write mode before unlink on replace failure in _write_json_atomic (WORLD-BUILD-STAGE-CLEANUP)
2026-11-29 19:36:31 +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
98c4c09cf8 PR #816: world_build: restore write mode before unlink on replace failure in _write_json_atomic (WORLD-BUILD-STAGE-CLEANUP)
From https://github.com/ProjectLeonida/mandy/pull/816 (head d90e4b213f), 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:15 -05:00
d90e4b213f world_build: restore write mode before unlink on replace failure in _write_json_atomic (WORLD-BUILD-STAGE-CLEANUP)
When writing world JSON atomically, if os.replace fails (for instance due to
permission errors), resetting os.chmod to 0o600 ensures unlinking the
temporary file does not fail on Windows with PermissionError.

agent: yes
AI-assisted: yes
2026-11-24 17:09:40 +03:00
198b5c5bcd world_build: drop a staged chunk PNG once no later chunk uses it (BUILD-WORLD-BAKED-PNG-BUDGET)
The staged build (spatial, grid and baked placements) decoded every chunk texture into a per-build
cache that kept each PNG until the build returned, so the decoded PNGs held grew with the chunk
count. Count each chunk's use of a texture before the chunks are written and drop the cache entry
when its last chunk takes it. A texture is still decoded once per build, waiters still share one
decode, and the chunks and world.json are byte-identical.

In a synthetic 24-chunk build, decoded PNGs alive while the last chunk is written fall from 26 to 3
(spatial, 1 worker) and the grid layout's peak from 26 to 11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:07:40 -05:00
d4a3e8f2be Restore read-only world chunks during Windows rollback (#6801)
Squash-merged after diff review of PR #6801 - world_build: restore read-only chunks during Windows rollback
2026-11-23 09:51:15 -06:00
438bf6f342 world_build: recover interrupted chunk publication on the next run (#6285)
Squash-merged after diff review of PR #6285 - world_build: recover interrupted chunk publication on the next run
2026-11-23 08:25:35 -06:00
956544023a Preview individual DDS mip levels, cube faces, array layers and volume slices (#6352)
Squash-merged after review of PR #6352 - Preview individual DDS mip levels, cube faces, array layers and volume slices
2026-11-23 08:16:00 -06:00
51a6feece1 Merge main into test-windows-nonascii
hw_oracle's vcvars script is fixed on main by #2667 (UTF-8 + chcp 65001), so this
branch takes main's runner.py and drops its own 8.3-name version. Two of main's
new hw_oracle tests decoded that UTF-8 script as ASCII, which fails when %TEMP%
holds a non-ASCII user name; they now decode it as UTF-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:28:03 +03:00
511732b468 hw_oracle: write the vcvars script for non-ASCII paths; more tests read child output right
A full run with the temp folder in a profile named in Cyrillic found:

- tools/hw_oracle/runner.py wrote build_hw_oracle.cmd with encoding
  "ascii", so any non-ASCII path (the temp work folder, Visual Studio,
  the source) raised UnicodeEncodeError before hw_oracle compiled
  anything. Non-ASCII paths now go in as their 8.3 short names, the file
  in the OEM code page cmd.exe reads it with (UTF-8 elsewhere). New check
  in test_hw_oracle: a work folder named "Пользователь".
- test_spirv_metal_set0_extra: its subprocess stubs didn't take the
  errors= argument this branch added to tools/spirv_metal_set0.py.
- test_user_sgpr_census, test_anim_index, test_awc_manifest,
  test_gamedata_graph, test_manifest_verifier, test_world_build: they
  decoded the Python child's output as UTF-8, but the tool writes in the
  locale encoding (the ANSI code page on Windows), so a non-ASCII temp
  path never matched; test_awc_manifest's reader thread died (no errors=).

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:52:11 +03:00
15f5b2fbc0 Fix what the round-41 merges broke
- tests/semantic: BaseVertex/BaseInstance read 0 in the wave interpreter; the LDS MockGens follow
  SHADER-309 (lds_bound, lds_access, lds_atomic); abs emission tests load their operand, since
  SHADER-315 folds scalar ALU on constants.
- test_translate: the dynamic gather sampler is a loaded word, not s16 + 0 (SHADER-315 folds it).
- test_world_build: DDS downscale weights colours by alpha (62804d0d).
- test_fspx_shaders_stage: the fake disassembler writes the listing make_game now checks.
- xgameruntime_test: re-read the package id after clearing the LEONIDA_PACKAGE_ID override.
- docs: one row per topic again in design.md (72 topics) and README.md; one Other languages line;
  embedded_shaders.md keeps one copy of each bullet; animation.md links the heading anchor.
- tools/scripts: character_textures uses report_paths.same_report_path; stdout guard on six programs;
  LF write in vs_input_survey; the cl.exe fallback compiles winhttp_offline.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:30:33 -05:00
f21f4ceb5a fix(world_build): keep staging with unrestored previous chunks across builds
_remove_stale_staging deleted every .chunks-staging-* directory, including one
whose previous/ held chunks a failed publish could not put back, so the recovery
copy named in the error was gone on the next build. Such a directory is now kept;
empty or incomplete staging is still removed. The build_world docstring now says
that readers can see old and new chunks mixed while publishing renames them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:08:27 +01:00
ee7218e653 world_build: stage chunk writes so a failed rebuild preserves existing chunks
Stage chunk generation in .chunks-staging-*/ on the output volume, verify sizes and headers, and publish via rename once all chunks succeed. Previous chunks are kept in a staging backup until world.json is committed; any error or interrupt rolls back to the previous intact world.json and chunk files. Leftover staging directories from killed builds are cleaned up on the next run. Adds WorldBuildStagingTest (6 synthetic tests covering failed chunk generation, corrupt chunk rejection, world.json write failure rollback, and leftover cleanup).
2026-11-22 06:54:48 +01:00
4730befe4d Merge pull request #942 from nicolas 2026-11-22 00:33:13 -05:00
56d1273ce7 Allow world exports to select the base-color texture parameter 2026-11-21 21:44:55 -07:00
adcf2c2f8a Keep large world chunks within streaming range at spawn 2026-11-21 20:54:52 -07:00
e0898944ac Merge pull request #426 from FreddyxS 2026-11-21 19:14:02 -05:00
906d5c5812 Exercise malformed world-build material metadata 2026-11-22 00:50:16 +01:00
56cd8afe83 glb_writer.py: keep mirrored OBJ faces front-facing 2026-11-22 00:13:17 +01:00
175a4d4bfe Merge pull request #277 from mrb-eel 2026-11-21 17:38:42 -05:00
c8081eb0ba Cancel distant viewer chunk downloads after camera moves 2026-11-21 23:12:33 +01:00
645f52d3c6 Merge pull request #244 from nicolas 2026-11-21 17:07:37 -05:00
7b7a42bd3a World builder: preserve output when no input models can load 2026-11-21 17:54:33 -04:00
ed9c90a463 viewer/serve.py: answer only requests addressed to 127.0.0.1 or localhost (DNS rebinding)
The viewer binds to 127.0.0.1, which keeps other machines out but not
other web pages: a page on any site can point its own domain at 127.0.0.1
(DNS rebinding) and then fetch http://<its domain>:8765/world/... as
same-origin, reading world.json and the .glb chunks built from the
player's copy. Those requests still carry the page's domain in the Host
header.

send_head now refuses (403) any request whose Host is not 127.0.0.1,
localhost or [::1] (any port, any case, trailing dot allowed). A request
with no Host header (a local tool, never a browser) is still served.

tests/test_world_build.py: host_allowed cases, and a live-server test
where Host rebind.example gets 403 without the world data while
localhost/127.0.0.1 get 200. Both fail on main.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:28:32 +03:00
d4ab78ffd7 World builder: preserve unrelated GLBs during chunk cleanup 2026-11-21 14:10:17 -07:00
691527329c tools, viewer: add stdlib world.json/.glb chunk builder and harden viewer 2026-11-21 16:10:06 -03:00