fix: mod-api on Windows: every fix its Windows tests turned up, in one pull request #2938

Merged
HumanBean merged 68 commits from llun/Longshot:fix/mod-api-testing-fixes into mod-api 2026-12-01 13:59:43 +00:00
Member

Summary

For #2822 (into mod-api). Every fix a Windows test of mod-api turned up, in one pull request, as asked: the eleven open pull requests below, rebased onto mod-api @ 5740a5df with their commits as they were reviewed, and the Windows bugs found since. Each commit is one fix or one check, a fix after the test that shows it. They close in favour of this one.

Carried over (each pull request's description says how to see its bug on mod-api):

Was What
#2824 longshot_builder.py build: the release's C++ runtime link-args reach rustc whole (they went in one character at a time)
#2826 Five game-free checks that fail only on Windows: their stand-ins follow the branch's host code (tests only)
#2829 Switching one mod off while the game runs no longer stops every other mod the start turned on
#2830 The workspace passes clippy for Windows' target (three lints behind their cfg, one new: GAME_BUILDER_E_FAILED imported on Unix only)
#2832 Windows: a changed folder mod's content module runs again while the game runs
#2834 Two builder checks that fail only on Windows: their fixtures name Windows' programs and whole paths (tests only)
#2835 Windows: an unchanged link is not run again (a drive's colon is no option's separator, in every argument: main's #2872, now in mod-api, skips the output's own argument, and compile_link's unchanged rebuild still linked again with it alone)
#2838 Windows: a confined game reads a profile past 260 characters (the file layer takes \\?\), the builder's file rules keeping every refusal
#2842 While the menu starts it says so, never that it could not start, and not over its page
#2844 longshot-game's integration tests link on Windows (the version text through host-sys)
#2845 Four game-side checks that fail only on Windows: whole paths, a file system that folds case (tests only)

#2827 and #2847 are not here: #2898 covers them (their closing comments say how).

New (each found by running mod-api's checks on Windows; how to see it is in its commit):

  • fix(sandbox): the file service opens what the game asks to write, and the folders it makes. After every open the service checks it is no link (GetFileInformationByHandleEx(FileAttributeTagInfo)), which Windows answers only for a handle with FILE_READ_ATTRIBUTES; a handle that cannot be told is taken as a link. The service opened with the game's own access, so on Windows every file a confined game opened to write only (GENERIC_WRITE) was refused, and every folder it made was made and then reported not made. Wine does not check the right, so files_windows' check passed there. open_in now adds the right to the service's own handle; the game's handle carries what it asked and the attributes' read every CreateFileW handle has (the next fix), which the check asserts.
  • fix(sandbox): the game's handle from the file service reads its attributes, as CreateFileW's does. Windows' CreateFileW gives every handle FILE_READ_ATTRIBUTES and SYNCHRONIZE beside what was asked; the service gave the confined game only what it asked. Rust's std::fs::metadata (and is_dir, is_file) opens with access 0 and reads the attributes by the handle, so every one of those calls on a file or folder the builder serves failed: the save list found no save, and dev.py smoke stayed on the title screen ("skip title: there is no saved game"). The rules decide on what was asked, as before; a STAT already tells the attributes of any path they let the game open, so the handle reads nothing more.
  • fix(bridge): a shot to a path is staged on Windows too. longshot_bridge.py and Longshot.exe mod shot asked the game on Windows to write the path itself (a pipe has no folder to stage beside), which a confined game cannot: dev.py smoke's menu shot failed ("the PNG could not be written"). On Windows a shot to a path is now staged in the game's temp/ as on Linux and moved by the client, read through no link (FILE_FLAG_OPEN_REPARSE_POINT in Rust; in Python the name is no reparse point and the file opened is the one looked at). With no path, the game writes its own default, as before.
  • fix(builder): an older build's user folder moves to the new place. settle flushed each copied file through File::open(...).sync_all(): Windows' FlushFileBuffers refuses a read-only handle, so every copy failed and the saves stayed in the game folder at every start.
  • fix(builder): a game file extracted before is checked whole, never taken as damaged. file_damaged read the zstd magic with read_at and hashed the rest from the file's position: Windows' seek_read moves it (Unix's pread does not), so every .zs a second extraction checked was counted damaged.
  • fix(builder): importing earlier saves never replaces a file at the profile's saves place. Linux's rename refuses a folder over a file and the import fails, leaving the earlier saves to try again; Windows' rename replaced the file and said it was done.
  • fix(mods): a mod whose id has a device's name takes screenshots. A part of the id that is nul (or con, aux, prn, comN, lptN on Windows 10) was a screenshots folder Windows cannot make: it gets _ first, as the mods' stores' files do.
  • docs(dev): on Windows, run the confined game from a shell outside a packaged app. A Store (MSIX) app that keeps AppData virtualized (the Claude desktop app is one) puts its processes' writes there in a copy of its own, and the tools it starts inherit that; the confined game sees the real folders, so the run folder and a staged shot are not where it looks. reference/build.md, Where dev data lives.
  • fix(builder): an older user folder's read-only file moves with it. The move flushes each copy through a handle that may write it, and Windows' copy keeps the read-only attribute: one read-only file kept the whole move back, tried again at every start. Such a copy is made writable for the flush, then read-only again (BeanBot's review, L2).
  • fix(dev): re.py closes the index it opened, so Windows can delete or replace it (test_re.py failed in its cleanup).
  • fix(builder): a base's file swapped for another is not linked into a runtime. A game folder's note keeps each file's (size, time, id); the id was 0 on Windows, and Windows' copy keeps the time, so another file of the same bytes was still linked. The note records Windows' file id now. A note written before (id 0) is taken only when the file's bytes are its SHA-256 too, read once, and the install that keeps it notes the id (BeanBot's review, L1), so no game folder copies its files again after the update, and no file swapped in meanwhile is kept, taken as the builder's or linked into a runtime.
  • fix(builder): the same source compiles to the same object. clang wrote the compile's time into each COFF object's header; the llvm-mingw route's compiles now take -mno-incremental-linker-compatible, as the link already takes /Brepro (compile_link's byte-for-byte check failed whenever two compiles fell in different seconds).
  • fix(dev): dev.py ab's report, and every dev.py tool's, to a pipe or a file is UTF-8 (cp1252 has no Δ: the report raised UnicodeEncodeError), and dev.py migrate leaves no base marked busy (it deleted its marker while it was open, which Windows refuses).
  • Tests only, from main's PRs the re-squash brought in: the host cores check (#2876) stands in for GetActiveProcessorCount, the count hos_cores asks Windows for; the profile symbols check leaves its ELF reader (Linux's) out on Windows, as where its tools are missing.
  • Tests only: the control pipe's check waits for the builder's instance (WaitNamedPipeW returns at once on Windows while there is none); user_of's check takes the game folder as user_of does (never \\?\); the screenshot check compares the settled path, not its debug text; prepare_only's check names the game program by this system's name; a package's second extraction expects the case pair written again where the file system folds case; the audio output devices' fixture takes the start's settings from the shared stand-in.

Read first: builder/crates/build-core/src/files_windows.rs (open_in, OPEN's give_access), scripts/longshot_bridge.py (take_shot, Bridge.request), then user_folder.rs (copy_tree), build-driver/src/folder.rs (stat_of, stat_matches), build-driver/src/play.rs (carry_saves), game-files/src/nup.rs (file_damaged), build-compile/src/toolchain.rs (reproducible_object).

Testing

Tested: On this PC: Windows 11 Pro (build 26300), RTX 5080 (NVIDIA 621.40), Ryzen 9 9900X3D. Everything built and run without MSVC: Rust 1.99.1 on the x86_64-pc-windows-gnullvm host, tools.lock's llvm-mingw for C and C++ and as linker; the builder and the runtime import no MSVC runtime (llvm-objdump -p).

  • In the game, confined (the log's sandbox: in the AppContainer), dev.py smoke: PASS (from kokiri-start: in play, 900 frames, the Insert menu open with its page system/menu, the bridge's shot staged in the game's temp\ and moved to the run folder; no FATAL line, every system mod started; files: 237 served by the builder at the first frame in play). Runtime made by dev.py rt at ee7b1726 with the builder at 545f97c6 (the file service's fixes); the shot's fix is the client's (longshot_bridge.py, at the head). On mod-api without them the same run stays on the title screen (skip title: there is no saved game), and with the first alone fails its shot (the PNG could not be written). A windowed run of the same runtime with the Insert menu opened over the bridge shows the menu over the game.
  • Game-free, Windows (mise run test's run_all.py --strict, 12 at once) at 13cf57a6 (the head but its docs note): 797 passed, 10 failed, 49 skipped. The 10: the nine renderer checks Risks names (they fail on main too) and test_lifter, whose workspace tests had one intermittent longshot-game failure (Risks; 187 of 187 in 8 runs alone). The skips are the checks whose tools this PC lacks (gcc, Linux-only ones). Rust: cargo fmt --check; clippy -D warnings for the workspace and modtool; tests of build-core (148), modtool (221), sites, longshot-game (187), and the workspace's earlier.
  • Game-free, Linux (WSL Ubuntu 24.04, an export of the branch): mise.toml's rust task's commands and run_all.py --strict at 809cbd68 (only environment failures, no glslang, spirv-val, llvm-mc or dav1d, and the nine renderer checks); for the last commits, fmt, clippy and the tests of modtool (243) and build-core (183), test_longshot_ctl (55), test_pipeline_tour, test_job_queue.
  • The sandbox's checks at the head: on Windows build-core's files_windows and files_rules tests (21) and sandbox_windows' with the crate's 148; on Linux test_sandbox_windows.py (19 checks: the start decision, the path form, the file service handing no more than the access decided), test_sandbox_linux.py, test_builder_files_linux.py, test_sandbox_profile.py, test_sandbox_save_folders.py, test_pad_appcontainer.py. test_builder_files_wine.py skipped there (no llvm-mingw in WSL); the same files_windows code's tests run natively here, where Windows checks the access rights Wine does not. The rules' normalizer refuses the plain form of every \\?\ path its test refuses (checked once, by hand), so the file layer's taking the prefix off opens no way around a rule.
  • The review's fixes (at 319bdf5e): each test fails before its fix and passes after; with the zero-id entry's hash check taken out, its test fails again. Windows: build-driver (219) and build-core's user_folder tests, fmt and clippy -D warnings for both crates. Linux: build-driver 244 of 244 in three whole runs, fmt and clippy for both crates. Builder code only (an install's note, the user folder's move): not run in the game since.
  • The reproducible-object flag (review L4): tools.lock's llvm-mingw clang, the 31 host C files that compile alone, -O2, without and with -mno-incremental-linker-compatible, through the queue: the objects the same bytes but the header's 4-byte time (335,411 bytes both ways); one file's compile 301 ms without, 279 ms with. The whole set's times are noise on this PC today (9 to 34 s a round, other builds running, no order by the flag); a quiet PC's numbers: by hand.
  • A Windows account that may not make links (this one makes them through Developer Mode alone, without SeCreateSymbolicLinkPrivilege): test_longshot_ctl.py's ShotStaging run with os.symlink refusing as Windows refuses such an account (WinError 1314): its two session tests pass, the link test is skipped saying why (no symbolic link can be made here: [WinError 1314] ...), its plain take and staged_at checks before the skip passing. modtool's windows_tests now takes its plain file before the link (e2d9c75a), so such an account runs that half: passing here with links, and with the link refused (a local edit, not committed, making the link fail with ERROR_PRIVILEGE_NOT_HELD): the plain file taken, then skipped: no symbolic link can be made here: A required privilege is not held by the client. (os error 1314). Not run from a real account without the right.
  • Each fix: its test (the commit before it) fails on mod-api for the bug's reason and passes here; with the fix's key line taken out, it fails again.

Still to test:

  • Linux in the game, confined (Landlock): none of these fixes is Linux's, but the shot's clients changed for both; no Linux PC here: @Beanstalk dev.py smoke on Linux, confined: in play from the save, the menu open, its shot taken.
  • Windows on AMD and Intel GPUs: the file service and the shots are no GPU's, but the in-game run is one card's: @Beanstalk dev.py smoke on Windows with an AMD and an Intel GPU, confined: in play from the save, the menu open, its shot taken.

Measurements

Nothing to measure: fixes and checks. The file service's handles gain the attribute read (its own checks, and the game's handle as CreateFileW's has it), and a bridge shot on Windows is moved once by the client; nothing on a path the game runs every frame changes. No switch is added: LONGSHOT_NO_CLANG in the diff is the tests' own variable mod-api already has (with no clang, a check that needs one passes over it, as a64's llvm-mc check does), which the object check follows.

Risks

The sandbox: as tight as mod-api has it, and checked. The file service's own handle can now read attributes, which its checks after every open need; the handle the game is given carries the access the request was allowed (or less, for a folder) and the attributes' read every CreateFileW handle carries, which a STAT already gives of any path the rules let the game open: the rules decide on what was asked, unchanged. The shot change is the clients' (outside the sandbox): the game writes only its own temp/, which it could already, and the client takes a plain file there through no link, on Windows as on Linux. Every refusal of the service's rules is unchanged; #2838's \\?\ paths keep every refusal (files_rules/windows.rs checks it). Nothing here touches the sandbox's plan or its grants. The sandbox is mod-api's only; main has none.

For players on Windows: an older build's user\ folder beside the game now does move to %APPDATA%\Longshot at the first start, as the move was meant to; a screenshot folder of a mod whose id has a device's name is named with _ first; an earlier saves' import with a file where the profile's saves go now fails and says so, and leaves the file. A revert is enough for each. On a drive that gives Windows no file ids (FAT32 or exFAT, some network shares), a game folder's note has none to record, and its entries are compared by size and time alone, as mod-api compares them now: a different file of the same size and time put in such a game folder could still be kept by a build, or linked into a runtime (a build after it is changed or removed puts it right). Hashing every file at every build there would close it, at a cost each build: not done.

Named, not changed here (as mod-api's rules have them): on a Windows PC with tools.lock's llvm-mingw alone (no gcc), the checks whose RUN_ALL_ARGS name gcc or g++ are skipped, or fail with --strict, as tests/run_all.py says of a compiler that is not there; about ten checks' own test programs pass a path through the ANSI code page and fail from a temporary folder whose path has a letter outside it (both on main too). modtool's the_typescript_system_mods_pass_their_tests failed once on this PC with two builds beside it and passed alone and in two whole runs (its cost checks read the wall clock on Windows): not changed, watched. Two tests are intermittent on Windows with their crate's other tests beside them, never alone (40 runs each): game-core's fixes::barrier::tests::an_or_and_its_wake_end_a_wait_on_another_thread (2 of 40: the waiter can see the OR itself before wake, which then finds no one) and game-sites' phase::tests::callbacks_run_by_order_then_by_when_added_and_stop_after_removal (1 of 40: on_thread reads the process-wide phase thread, which another test's run of the same phase moves): test races, not changed. One more, seen once in a whole run under load and never alone (187 of 187, 8 runs): longshot-game's settings_now::tests::a_new_installs_output_resolution_is_the_size_the_run_started_at, whose new install's size is skipped when the process-wide AT_START was first filled by a test whose settings are the Handheld profile's (set_up_for_a_weak_laptop_is_a_preset_of_the_games, a_preset_chosen_in_the_game_sets_its_rows_and_a_row_changed_makes_it_custom): test order, not changed. And on Linux, build-driver's dev_runtime::tests::a_copy_links_the_builders_files_clones_the_rest_and_refreshes_in_place fails now and then with the whole crate's tests beside it, on mod-api too (3 of 6 runs at 5740a5df: game_folder_busy, the runtime's folder lock still held at its next copy), never alone; a_give_back_skips_a_unit_a_running_game_holds failed once so: not changed. Nine renderer checks fail on every system on main @ 4908cc6d and on mod-api alike (test_blocks_at_start, test_draw_stream_visibility, test_fsr_uniform_ownership, test_image_reaper_threads, test_readback_timeout_reuse, test_recording_admission, test_target_retention, test_tex_desc_memo, test_vram_compact: their cuts of gpu/vk no longer match it), main's to mend, not this pull request's.

Checklist

Ready for review

  • One topic, on current mod-api; the title is a Conventional Commit. (One topic: mod-api's Windows fixes, in one pull request as asked; on mod-api @ 5740a5df.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on mod-api is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on mod-api and passes here (each fix's key line taken out, its test fails).
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths (the checks whose test programs take a path through the ANSI code page are named in Risks).
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head.

🤖 Generated with Claude Code

## Summary For [#2822](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822) (into `mod-api`). Every fix a Windows test of `mod-api` turned up, in one pull request, as asked: the eleven open pull requests below, rebased onto `mod-api` @ 5740a5df with their commits as they were reviewed, and the Windows bugs found since. Each commit is one fix or one check, a fix after the test that shows it. They close in favour of this one. **Carried over** (each pull request's description says how to see its bug on `mod-api`): | Was | What | |---|---| | [#2824](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2824) | `longshot_builder.py build`: the release's C++ runtime link-args reach rustc whole (they went in one character at a time) | | [#2826](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2826) | Five game-free checks that fail only on Windows: their stand-ins follow the branch's host code (tests only) | | [#2829](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2829) | Switching one mod off while the game runs no longer stops every other mod the start turned on | | [#2830](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2830) | The workspace passes clippy for Windows' target (three lints behind their `cfg`, one new: `GAME_BUILDER_E_FAILED` imported on Unix only) | | [#2832](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2832) | Windows: a changed folder mod's content module runs again while the game runs | | [#2834](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2834) | Two builder checks that fail only on Windows: their fixtures name Windows' programs and whole paths (tests only) | | [#2835](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2835) | Windows: an unchanged link is not run again (a drive's colon is no option's separator, in every argument: `main`'s [#2872](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2872), now in `mod-api`, skips the output's own argument, and `compile_link`'s unchanged rebuild still linked again with it alone) | | [#2838](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2838) | Windows: a confined game reads a profile past 260 characters (the file layer takes `\\?\`), the builder's file rules keeping every refusal | | [#2842](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2842) | While the menu starts it says so, never that it could not start, and not over its page | | [#2844](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2844) | longshot-game's integration tests link on Windows (the version text through host-sys) | | [#2845](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2845) | Four game-side checks that fail only on Windows: whole paths, a file system that folds case (tests only) | [#2827](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2827) and [#2847](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2847) are not here: [#2898](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2898) covers them (their closing comments say how). **New** (each found by running `mod-api`'s checks on Windows; how to see it is in its commit): - **fix(sandbox): the file service opens what the game asks to write, and the folders it makes.** After every open the service checks it is no link (`GetFileInformationByHandleEx(FileAttributeTagInfo)`), which Windows answers only for a handle with `FILE_READ_ATTRIBUTES`; a handle that cannot be told is taken as a link. The service opened with the game's own access, so on Windows every file a confined game opened to write only (`GENERIC_WRITE`) was refused, and every folder it made was made and then reported not made. Wine does not check the right, so `files_windows`' check passed there. `open_in` now adds the right to the service's own handle; the game's handle carries what it asked and the attributes' read every CreateFileW handle has (the next fix), which the check asserts. - **fix(sandbox): the game's handle from the file service reads its attributes, as CreateFileW's does.** Windows' CreateFileW gives every handle `FILE_READ_ATTRIBUTES` and `SYNCHRONIZE` beside what was asked; the service gave the confined game only what it asked. Rust's `std::fs::metadata` (and `is_dir`, `is_file`) opens with access 0 and reads the attributes by the handle, so every one of those calls on a file or folder the builder serves failed: the save list found no save, and `dev.py smoke` stayed on the title screen ("skip title: there is no saved game"). The rules decide on what was asked, as before; a STAT already tells the attributes of any path they let the game open, so the handle reads nothing more. - **fix(bridge): a shot to a path is staged on Windows too.** `longshot_bridge.py` and `Longshot.exe mod shot` asked the game on Windows to write the path itself (a pipe has no folder to stage beside), which a confined game cannot: `dev.py smoke`'s menu shot failed ("the PNG could not be written"). On Windows a shot to a path is now staged in the game's `temp/` as on Linux and moved by the client, read through no link (`FILE_FLAG_OPEN_REPARSE_POINT` in Rust; in Python the name is no reparse point and the file opened is the one looked at). With no path, the game writes its own default, as before. - **fix(builder): an older build's user folder moves to the new place.** `settle` flushed each copied file through `File::open(...).sync_all()`: Windows' FlushFileBuffers refuses a read-only handle, so every copy failed and the saves stayed in the game folder at every start. - **fix(builder): a game file extracted before is checked whole, never taken as damaged.** `file_damaged` read the zstd magic with `read_at` and hashed the rest from the file's position: Windows' `seek_read` moves it (Unix's pread does not), so every `.zs` a second extraction checked was counted damaged. - **fix(builder): importing earlier saves never replaces a file at the profile's saves place.** Linux's rename refuses a folder over a file and the import fails, leaving the earlier saves to try again; Windows' rename replaced the file and said it was done. - **fix(mods): a mod whose id has a device's name takes screenshots.** A part of the id that is `nul` (or `con`, `aux`, `prn`, `comN`, `lptN` on Windows 10) was a screenshots folder Windows cannot make: it gets `_` first, as the mods' stores' files do. - **docs(dev): on Windows, run the confined game from a shell outside a packaged app.** A Store (MSIX) app that keeps AppData virtualized (the Claude desktop app is one) puts its processes' writes there in a copy of its own, and the tools it starts inherit that; the confined game sees the real folders, so the run folder and a staged shot are not where it looks. `reference/build.md`, Where dev data lives. - **fix(builder): an older user folder's read-only file moves with it.** The move flushes each copy through a handle that may write it, and Windows' copy keeps the read-only attribute: one read-only file kept the whole move back, tried again at every start. Such a copy is made writable for the flush, then read-only again (BeanBot's review, L2). - **fix(dev): `re.py` closes the index it opened**, so Windows can delete or replace it (`test_re.py` failed in its cleanup). - **fix(builder): a base's file swapped for another is not linked into a runtime.** A game folder's note keeps each file's (size, time, id); the id was 0 on Windows, and Windows' copy keeps the time, so another file of the same bytes was still linked. The note records Windows' file id now. A note written before (id 0) is taken only when the file's bytes are its SHA-256 too, read once, and the install that keeps it notes the id (BeanBot's review, L1), so no game folder copies its files again after the update, and no file swapped in meanwhile is kept, taken as the builder's or linked into a runtime. - **fix(builder): the same source compiles to the same object.** clang wrote the compile's time into each COFF object's header; the llvm-mingw route's compiles now take `-mno-incremental-linker-compatible`, as the link already takes `/Brepro` (`compile_link`'s byte-for-byte check failed whenever two compiles fell in different seconds). - **fix(dev): `dev.py ab`'s report, and every `dev.py` tool's, to a pipe or a file is UTF-8** (cp1252 has no Δ: the report raised UnicodeEncodeError), and **`dev.py migrate` leaves no base marked busy** (it deleted its marker while it was open, which Windows refuses). - **Tests only, from `main`'s PRs the re-squash brought in:** the host cores check (#2876) stands in for `GetActiveProcessorCount`, the count `hos_cores` asks Windows for; the profile symbols check leaves its ELF reader (Linux's) out on Windows, as where its tools are missing. - **Tests only:** the control pipe's check waits for the builder's instance (`WaitNamedPipeW` returns at once on Windows while there is none); `user_of`'s check takes the game folder as `user_of` does (never `\\?\`); the screenshot check compares the settled path, not its debug text; `prepare_only`'s check names the game program by this system's name; a package's second extraction expects the case pair written again where the file system folds case; the audio output devices' fixture takes the start's settings from the shared stand-in. Read first: `builder/crates/build-core/src/files_windows.rs` (`open_in`, OPEN's `give_access`), `scripts/longshot_bridge.py` (`take_shot`, `Bridge.request`), then `user_folder.rs` (`copy_tree`), `build-driver/src/folder.rs` (`stat_of`, `stat_matches`), `build-driver/src/play.rs` (`carry_saves`), `game-files/src/nup.rs` (`file_damaged`), `build-compile/src/toolchain.rs` (`reproducible_object`). ## Testing **Tested:** On this PC: Windows 11 Pro (build 26300), RTX 5080 (NVIDIA 621.40), Ryzen 9 9900X3D. Everything built and run without MSVC: Rust 1.99.1 on the `x86_64-pc-windows-gnullvm` host, `tools.lock`'s llvm-mingw for C and C++ and as linker; the builder and the runtime import no MSVC runtime (`llvm-objdump -p`). - **In the game, confined (the log's `sandbox: in the AppContainer`), `dev.py smoke`: PASS** (from `kokiri-start`: in play, 900 frames, the Insert menu open with its page `system/menu`, the bridge's shot staged in the game's `temp\` and moved to the run folder; no FATAL line, every system mod started; `files: 237 served by the builder` at the first frame in play). Runtime made by `dev.py rt` at ee7b1726 with the builder at 545f97c6 (the file service's fixes); the shot's fix is the client's (`longshot_bridge.py`, at the head). On `mod-api` without them the same run stays on the title screen (`skip title: there is no saved game`), and with the first alone fails its shot (`the PNG could not be written`). A windowed run of the same runtime with the Insert menu opened over the bridge shows the menu over the game. - **Game-free, Windows** (`mise run test`'s `run_all.py --strict`, 12 at once) at 13cf57a6 (the head but its docs note): 797 passed, 10 failed, 49 skipped. The 10: the nine renderer checks Risks names (they fail on `main` too) and `test_lifter`, whose workspace tests had one intermittent `longshot-game` failure (Risks; 187 of 187 in 8 runs alone). The skips are the checks whose tools this PC lacks (gcc, Linux-only ones). Rust: `cargo fmt --check`; clippy `-D warnings` for the workspace and `modtool`; tests of `build-core` (148), `modtool` (221), `sites`, `longshot-game` (187), and the workspace's earlier. - **Game-free, Linux** (WSL Ubuntu 24.04, an export of the branch): `mise.toml`'s `rust` task's commands and `run_all.py --strict` at 809cbd68 (only environment failures, no glslang, spirv-val, llvm-mc or dav1d, and the nine renderer checks); for the last commits, fmt, clippy and the tests of `modtool` (243) and `build-core` (183), `test_longshot_ctl` (55), `test_pipeline_tour`, `test_job_queue`. - **The sandbox's checks at the head:** on Windows `build-core`'s `files_windows` and `files_rules` tests (21) and `sandbox_windows`' with the crate's 148; on Linux `test_sandbox_windows.py` (19 checks: the start decision, the path form, the file service handing no more than the access decided), `test_sandbox_linux.py`, `test_builder_files_linux.py`, `test_sandbox_profile.py`, `test_sandbox_save_folders.py`, `test_pad_appcontainer.py`. `test_builder_files_wine.py` skipped there (no llvm-mingw in WSL); the same `files_windows` code's tests run natively here, where Windows checks the access rights Wine does not. The rules' normalizer refuses the plain form of every `\\?\` path its test refuses (checked once, by hand), so the file layer's taking the prefix off opens no way around a rule. - **The review's fixes** (at 319bdf5e): each test fails before its fix and passes after; with the zero-id entry's hash check taken out, its test fails again. Windows: `build-driver` (219) and `build-core`'s `user_folder` tests, fmt and clippy `-D warnings` for both crates. Linux: `build-driver` 244 of 244 in three whole runs, fmt and clippy for both crates. Builder code only (an install's note, the user folder's move): not run in the game since. - **The reproducible-object flag** (review L4): tools.lock's llvm-mingw clang, the 31 host C files that compile alone, -O2, without and with `-mno-incremental-linker-compatible`, through the queue: the objects the same bytes but the header's 4-byte time (335,411 bytes both ways); one file's compile 301 ms without, 279 ms with. The whole set's times are noise on this PC today (9 to 34 s a round, other builds running, no order by the flag); a quiet PC's numbers: by hand. - **A Windows account that may not make links** (this one makes them through Developer Mode alone, without `SeCreateSymbolicLinkPrivilege`): `test_longshot_ctl.py`'s `ShotStaging` run with `os.symlink` refusing as Windows refuses such an account (`WinError 1314`): its two session tests pass, the link test is skipped saying why (`no symbolic link can be made here: [WinError 1314] ...`), its plain take and `staged_at` checks before the skip passing. `modtool`'s `windows_tests` now takes its plain file before the link (e2d9c75a), so such an account runs that half: passing here with links, and with the link refused (a local edit, not committed, making the link fail with `ERROR_PRIVILEGE_NOT_HELD`): the plain file taken, then `skipped: no symbolic link can be made here: A required privilege is not held by the client. (os error 1314)`. Not run from a real account without the right. - **Each fix:** its test (the commit before it) fails on `mod-api` for the bug's reason and passes here; with the fix's key line taken out, it fails again. **Still to test:** - Linux in the game, confined (Landlock): none of these fixes is Linux's, but the shot's clients changed for both; no Linux PC here: `@Beanstalk dev.py smoke on Linux, confined: in play from the save, the menu open, its shot taken`. - Windows on AMD and Intel GPUs: the file service and the shots are no GPU's, but the in-game run is one card's: `@Beanstalk dev.py smoke on Windows with an AMD and an Intel GPU, confined: in play from the save, the menu open, its shot taken`. ## Measurements Nothing to measure: fixes and checks. The file service's handles gain the attribute read (its own checks, and the game's handle as CreateFileW's has it), and a bridge shot on Windows is moved once by the client; nothing on a path the game runs every frame changes. No switch is added: `LONGSHOT_NO_CLANG` in the diff is the tests' own variable `mod-api` already has (with no clang, a check that needs one passes over it, as `a64`'s llvm-mc check does), which the object check follows. ## Risks **The sandbox:** as tight as `mod-api` has it, and checked. The file service's own handle can now read attributes, which its checks after every open need; the handle the game is given carries the access the request was allowed (or less, for a folder) and the attributes' read every CreateFileW handle carries, which a STAT already gives of any path the rules let the game open: the rules decide on what was asked, unchanged. The shot change is the clients' (outside the sandbox): the game writes only its own `temp/`, which it could already, and the client takes a plain file there through no link, on Windows as on Linux. Every refusal of the service's rules is unchanged; [#2838](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2838)'s `\\?\` paths keep every refusal (`files_rules/windows.rs` checks it). Nothing here touches the sandbox's plan or its grants. The sandbox is `mod-api`'s only; `main` has none. For players on Windows: an older build's `user\` folder beside the game now does move to `%APPDATA%\Longshot` at the first start, as the move was meant to; a screenshot folder of a mod whose id has a device's name is named with `_` first; an earlier saves' import with a file where the profile's saves go now fails and says so, and leaves the file. A revert is enough for each. On a drive that gives Windows no file ids (FAT32 or exFAT, some network shares), a game folder's note has none to record, and its entries are compared by size and time alone, as `mod-api` compares them now: a different file of the same size and time put in such a game folder could still be kept by a build, or linked into a runtime (a build after it is changed or removed puts it right). Hashing every file at every build there would close it, at a cost each build: not done. Named, not changed here (as `mod-api`'s rules have them): on a Windows PC with tools.lock's llvm-mingw alone (no gcc), the checks whose `RUN_ALL_ARGS` name gcc or g++ are skipped, or fail with `--strict`, as `tests/run_all.py` says of a compiler that is not there; about ten checks' own test programs pass a path through the ANSI code page and fail from a temporary folder whose path has a letter outside it (both on `main` too). `modtool`'s `the_typescript_system_mods_pass_their_tests` failed once on this PC with two builds beside it and passed alone and in two whole runs (its cost checks read the wall clock on Windows): not changed, watched. Two tests are intermittent on Windows with their crate's other tests beside them, never alone (40 runs each): `game-core`'s `fixes::barrier::tests::an_or_and_its_wake_end_a_wait_on_another_thread` (2 of 40: the waiter can see the OR itself before `wake`, which then finds no one) and `game-sites`' `phase::tests::callbacks_run_by_order_then_by_when_added_and_stop_after_removal` (1 of 40: `on_thread` reads the process-wide phase thread, which another test's run of the same phase moves): test races, not changed. One more, seen once in a whole run under load and never alone (187 of 187, 8 runs): `longshot-game`'s `settings_now::tests::a_new_installs_output_resolution_is_the_size_the_run_started_at`, whose new install's size is skipped when the process-wide `AT_START` was first filled by a test whose settings are the Handheld profile's (`set_up_for_a_weak_laptop_is_a_preset_of_the_games`, `a_preset_chosen_in_the_game_sets_its_rows_and_a_row_changed_makes_it_custom`): test order, not changed. And on Linux, `build-driver`'s `dev_runtime::tests::a_copy_links_the_builders_files_clones_the_rest_and_refreshes_in_place` fails now and then with the whole crate's tests beside it, on `mod-api` too (3 of 6 runs at 5740a5df: `game_folder_busy`, the runtime's folder lock still held at its next copy), never alone; `a_give_back_skips_a_unit_a_running_game_holds` failed once so: not changed. Nine renderer checks fail on every system on `main` @ 4908cc6d and on `mod-api` alike (`test_blocks_at_start`, `test_draw_stream_visibility`, `test_fsr_uniform_ownership`, `test_image_reaper_threads`, `test_readback_timeout_reuse`, `test_recording_admission`, `test_target_retention`, `test_tex_desc_memo`, `test_vram_compact`: their cuts of `gpu/vk` no longer match it), `main`'s to mend, not this pull request's. ## Checklist ### Ready for review - [x] One topic, on current `mod-api`; the title is a Conventional Commit. (One topic: `mod-api`'s Windows fixes, in one pull request as asked; on `mod-api` @ 5740a5df.) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `mod-api` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `mod-api` and passes here (each fix's key line taken out, its test fails). - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths (the checks whose test programs take a path through the ANSI code page are named in Risks). - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
llun added 63 commits 2026-12-01 06:43:48 +00:00
`cargo clippy --target x86_64-pc-windows-gnullvm -- -D warnings` (mise.toml: "the Windows target checks the builder for
Windows") failed on three things that only a Windows build sees:
- build-core/src/control.rs: into_game, #[cfg(windows)], came after the test modules (items_after_test_module): moved
  above them, unchanged;
- build-compile/src/rust.rs: the tests' builds() is used by #[cfg(unix)] tests only (dead_code): #[cfg(unix)], as
  fake_cargo beside it;
- longshot-game/src/builder_link/files.rs: GAME_BUILDER_E_FAILED is used by the #[cfg(unix)] game_builder_file_fd
  only (unused_imports): imported under #[cfg(unix)].
Linux's build and its clippy are unchanged: each change is behind its cfg.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
version_text called hos_version itself, with a stand-in only under cfg(test): the crate's unit tests, not its
integration tests (tests/startup_layout.rs, tests/registry.rs), which build the library as the game does. There the
real call stayed, and on Windows, where the exported hos_perf_info that returns it keeps it in the link,
cargo test -p longshot-game could not link: "undefined symbol: hos_version". host_sys::info::version_c is the host's
static text, or a static stand-in in host-sys's fake host, which every test build of the crate has; the game's own build
calls the host as before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
longshot-game's mod-tests plan joins a suite's folder with Path::join, so its expected LONGSHOT_DEV_MODS is the suite's
folder joined too, not a written "/t/suite/hud". The saves tests rooted the user and launcher folders at "/u" and
"/profiles/two", which Windows takes as rooted but not whole: the profile's folder, made whole with
std::path::absolute, took the current drive, and the comparisons failed on "C:". They start from a whole path on each
system now (whole()); every assertion stays, the one that the mod's profile sits inside the launcher's granted save/
subtree too. modtool's emulators test wrote Eden's title-id folder in lower and in capitals, two folders on Linux, one
on Windows and macOS, whose file systems fold case: there the one folder's mods come by name, and the test reads the
order the file system gives and finds Speed and Grass by name.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each failed on mod-api on Windows (cargo test --target x86_64-pc-windows-gnullvm) and passes there now, and on Linux:
- build-compile's toolchain::tests::the_builder_s_llvm_comes_before_emsdk_and_the_path: the fake LONGSHOT_LLVM held
  `clang` and `ld.lld`, which find() looks for as `clang.exe` and `ld.lld.exe` on Windows, so it found the PATH's clang
  instead: the fixture's programs are named with std::env::consts::EXE_SUFFIX;
- build-core's driver_caches::tests::the_caches_are_longshots_own_unless_one_is_named: plan() takes HOME and
  XDG_CACHE_HOME only when whole, and `/h` is not on Windows (left: []): the test's paths are rooted at `C:` there.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/hos_file_windows.c's whole_utf8 cut and compiled with the PC's C compiler, given each path form: \?\C:\... and
\?\UNC\server\share\... must be the builder's, in their plain form, as C:\... and \server\... are; a device's path, a
pipe and the console never. It fails on mod-api: the prefixed forms are never the builder's, so in a profile past 260
characters the confined game's Rust read nothing of it ("settings.toml could not be read (Access is denied. (os
error 5))", "profile.json is not a list of mods (Access is denied ...)"). Windows only (RUN_ALL_SKIP on Linux).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/hos_file_windows.c hands the builder only a drive's or a share's path, and GetFullPathNameW leaves a path with
Windows' extended-length prefix as it is. Rust's std gives a path past MAX_PATH that prefix (\?\C:\...), so in a
profile that long every file the game's Rust opens, lists or reads there stayed a native call the AppContainer refuses:
settings.toml "could not be read (Access is denied. (os error 5)): every setting at its default", profile.json "is not
a list of mods", a development mod's folder empty. whole_utf8 now takes \?\C:\... and \?\UNC\server\share\... too,
and hands them on in their plain form, which the builder's rules take; a device's path stays never the builder's.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The file layer now hands the builder a path with the \?\ prefix (in its plain form). Under the prefix Windows takes a
name as it is: `..`, a trailing dot or space and `:` are names there. files_rules::norm must refuse each of those in that
form as it does in the plain one (it strips the prefix and checks the rest: path_norm), never take the plain path's
meaning, and a \?\ path that is not a drive's or a share's (a volume's, GLOBALROOT, a pipe) is none of the service's.
It passes on mod-api: the change keeps the sandbox's refusals; this pins them.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each failed on Windows (mise run test, llvm-mingw clang, Windows 11) and passed on main at the merge base; each passes
here on Windows and on Linux:
- audio_output_devices: options_path.h's hos_options_line now asks the game's game_setting_line: a stand-in that
  reads the test's longshot_options.ini line, as the file did (was: ld.lld undefined symbol game_setting_line);
- audio_source_load: romfs_index.c's Windows side includes sandbox_win_plan.h (and sandbox_plan.h): both copied in
  (was: 'sandbox_win_plan.h' file not found);
- present_sites: the fixture's unsetenv, which Windows' C runtime lacks, is _putenv("NAME=") there (was: call to
  undeclared function 'unsetenv');
- longshot_ctl: ShotStaging skipped on Windows, where a named pipe has no folder and nothing is staged (shot_stage is
  None there by design), and the session's shot checked without the staged path there (was: KeyError 'game_path',
  shot_stage None);
- menu_hooks: the dlss lock's line compared as text: it is made again at each call, and Windows' heap gives the new
  one another address than the first (was: "the dlss lock by key is not lock_dlss", same text at two addresses).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ShotStaging was skipped on Windows as a whole. Only its two staging tests are Windows-less now (a named pipe has no
folder: nothing is staged, so nothing is moved, and no link can be left to follow); the third runs there too and checks
what holds on Windows: the game is asked to write the path itself, and the player's file the game names elsewhere is
neither read into the shot nor removed. Linux checks it as before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The release's builder links glslang's C++ runtime in (-l:libc++.a, -l:libc++abi.a on Windows, -l:libstdc++.a on
Linux). The check now looks for them in CARGO_ENCODED_RUSTFLAGS, each flag whole, and asks that no flag is one
character. It fails on mod-api: the flags are added to the list as a string, one character at a time.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`flags += " -C link-arg=..."` added a string to the list of rustc's flags one character at a time, so
CARGO_ENCODED_RUSTFLAGS held " ", "-", "C", ... and the release's builder (both systems) did not get its
-l:libc++.a / -l:libstdc++.a. The flags are now list items, as the rest of the function's are.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two player's script mods profile.json lists on, running; a/two switched off in the Mods tab while the game runs. a/two
must stop and a/one run on. It fails on mod-api: a/one is Off too (in the game, switching one mod off in profile.json
while it ran stopped every player's and development mod: "local/rupee-alarm turned off in the Mods tab").

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A player's and a development mod's row is made off (Row::new(..., false)) and the profile's list, or the run, turns it
on; the start brought start_enabled up to date with that, but not the live switch, switch_on, which only the system
mods' rows were given (put_systems). So every player's and development mod ran with switch_on false, the Mods tab
showed it off, and the first switch's pass while the game ran (the tab's, or profile.json changed by the launcher)
stopped them all with "turned off in the Mods tab". The start now sets switch_on with start_enabled.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With the live switch now the list's at the start, a switch's pass sees every listed mod on. It must start nothing the
start held back: a/one, listed on but without its state.read granted, waits; a/two is switched off while the game runs;
a/one still waits and is never started (the pass starts a switched-on mod only through can_start's grants, after the
confinement's check). It passes: the fix keeps the gates; this pins them.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two player's script mods the list turns on, in a game not confined: both held by the sandbox (Cannot). a/two switched
off while the game runs; a/one stays held and no script is started (a switch's pass starts a script only after the
confinement's check, and a held row is never one it starts). It passes: the fix keeps the sandbox's hold; this pins it.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The watch hands the loader the folders whose served files changed with `/` between their names (watch.rs's slashes);
a row's path is the profile's, joined with `\`. A Windows-only test of loader::same_path with both forms, another
letter case, and another folder. It fails on mod-api ("the watch's form"): same_path compares the two as text, so on
Windows a changed folder matches no mod, and tests::a_content_mods_changed_module_runs_again_and_its_outputs_are_served
fails there for the same reason (it passes on Linux).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The watch hands the loader the folders whose served files changed with `/` between their names (watch.rs's slashes),
and same_path compared them with the rows' paths, which keep Windows' `\`, as text (any case). On Windows no changed
folder matched its mod, so hot_layers rebuilt the layers for no mod: a content module was never run again, and the log
named "a mod". same_path now takes either separator on Windows, any case as before. Linux is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
At a start the menu opens before its system mods run when a mod asks for its permissions (the prompt opens it), and the
engine's fallback page shows in system/menu's place until they run. A menu mod whose row is Pending (it starts at a next
frame) must be said to be starting, never "could not start" / "did not start". It fails on mod-api: the fallback said
"Longshot's menu could not start" for the seconds the menu's mods took to start, at every start with such a mod.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a mod asks for its permissions at a start, the prompt opens the Insert menu before system/menu and system/mods-tab
run (the scripts start one a frame, the system mods first), and the engine's fallback page stands in for them till they
do. It read their Pending rows as never started: "Longshot's menu could not start ... did not start, so this is the
fallback. The log says why", for a few seconds at every such start, though nothing failed. Down gets Starting, for a
row that waits for its frame: "Longshot's menu is starting", "The menu's system mod (%s) is starting: it shows in a
moment.", in each of game/strings' languages. A failed start, a missing mod and a stop are said as before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The menu's frame drew its line from the hosted page of two presents before (the frame took UI's last frame's hosted
roots, and UI's thread is a present behind), so the first two frames of an open, and of the fallback page at a start,
drew "The menu is starting." over the page's title. Through the game's own input (input_of) and frame (MenuFrame) on
UI's core: in a tick that hosts system/menu's page the line is not laid out, and in one that hosts none it is. The first
fails on mod-api: the line is laid out over the page.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The frame drew its line while the hosted page of two presents before was missing (game_ui_present read UI's last
frame, and UI's thread is a present behind), so the first two frames of every open, and of the fallback page at a
start, drew it over the page's title. The line is a tree of its own now, engine:menu-starting, beside the frame's, and
UI's core leaves its screens out of a tick that hosts a page (Host::unhosted, which only the game's input sets): the
page and the line are decided in the same tick. The frame's help box still follows the page as before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
control::pipe_tests::the_pipe_is_the_builder_s_and_this_user_s_alone (#2898) waited for the builder's pipe with
WaitNamedPipeW, 50 ms a try. On Windows the call returns at once while no instance has the name, so all 100 tries could
pass before the serving thread made it ("the builder's instance"); Wine waits, so the check passed there. A try that
finds none now sleeps 50 ms before the next. Every assertion after it is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
user_folder::tests::the_user_folder_a_start_s_arguments_give canonicalized the game folder on every system, and on
Windows that is the `\?\` form (`\?\C:\...\game\u`); user_of takes the program's folder as it is there (it
canonicalizes on Unix only), so `--user u` gave `C:\...\game\u` and the check failed. The test now takes it the same
way on each system; what user_of returns is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
settle copies an older build's `user/` into the new place (%APPDATA%\Longshot) and flushes each file copied with
`File::open(to)?.sync_all()`. On Windows that is FlushFileBuffers, which refuses a handle opened only to read
(ERROR_ACCESS_DENIED), so every copy counted as failed, the move was called off, and the saves stayed in the game
folder at every start ("saves: N entries of ... could not go to ...").

The copy is now opened to write on Windows before the flush (Linux's open is the same as before: fsync takes a
read-only descriptor, and a file copied read-only still opens). user_folder's an_older_build_s_user_folder_is_moved_whole
and a_move_cut_at_any_step_leaves_every_save_in_the_place_the_next_start_uses failed on Windows for this reason and
pass with it; every refusal settle has (a link, a journal not finished, a clash) is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
services::gfx::tests::a_screenshot_goes_to_the_mods_folder_and_settles_with_its_path looked for the file's path in
`format!("{got:?}")`. On Windows the path holds `\`, which the settled JSON escapes and the debug text escapes again
(`\\`), so the plain path was never found and the check failed though the screenshots settled with the right path.
It now compares each settled value with the path as JSON. It also checks all four, where it checked the first's kind.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
gfx.screenshot keeps a mod's shots in folders named by its id's parts (`<user>/screenshots/<publisher>/<name>/`). An
id's part may be `nul`, `con`, `aux`, `prn`, `com1`-`com9` or `lpt1`-`lpt9` (lower-case letters and digits), and on
Windows a folder of that name opens the device: on Windows 11, making `screenshots\nul` fails ("the system cannot find
the path specified"; `con`, `aux` and the rest are made there but not on Windows 10), so every screenshot of such a
mod settled null. The mods' stores already give such a name `_` first (storage::file_name). The check fails here, for
that reason, and passes with the next commit.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After every open the file service checks what it opened (open_in, opened_ok): its final path, and that it is no link,
by GetFileInformationByHandleEx(FileAttributeTagInfo). Windows answers that only for a handle with
FILE_READ_ATTRIBUTES; without it the check failed, and a handle that cannot be told is taken as a link (fails closed).
The service opened with the game's own access (Open) or with FILE_LIST_DIRECTORY | SYNCHRONIZE (Mkdir), so on Windows
every file the game opened to write only (GENERIC_WRITE, as fopen "wb" and CreateFileW's usual write do) was refused
with ERROR_ACCESS_DENIED, and every folder it made was made, then reported as not made. Wine does not check the right,
so files_windows' the_cache_takes_files_folders_renames_and_removes, run under Wine, passed; on Windows it failed there.

open_in now adds FILE_READ_ATTRIBUTES to the service's own handle. The sandbox stays as tight: what the game is given
is unchanged (give duplicates the handle with the access the request was allowed, d.access, or less for a folder),
and every check after the open runs as before, now able to run. The test also checks it: the handle the game gets for
a write-only open cannot read attributes.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
shot_folder now gives a part of a mod's id that is one of Windows' device names (`nul`, `con`, `aux`, `prn`, `comN`,
`lptN`, before a first `.`) `_` first, through storage's own device_name, made pub(crate) for it. No id's part begins
with `_`, so no two mods share a folder still. Linux's folders change for such an id too: one rule on every system, as
the mods' stores have it.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
re.py's run opened the index (Index, a read-only SQLite connection) for every query and for `index`'s counts and never
closed it. The connection's own statement cache keeps it alive past the last reference until a garbage collection, so
the file stayed open after the command returned. Linux deletes or replaces an open file; Windows does neither:
tests/test_re.py's Index class failed on Windows in its tearDownClass ("[WinError 32] The process cannot access the file
because it is being used by another process: ...\index.sqlite"), after test_the_commands_print_json ran the `fn`
command in the test's own process. run now closes the index it opened before printing, in both places.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/audio_output_devices.c now reads the start's Output device through host/game_settings.h's HOS_SETTING_START, that
is game_settings_at_start() (mod-api's settings, 4f9a9969), which the fixture did not stand in for: its link failed
on Windows ("undefined symbol: game_settings_at_start"; the check is Windows-only). It now includes
tests/fixtures/game_options_stub.h, which the other audio checks use, after host/game_settings.h as the stub asks, in
place of its own game_setting_line: the start's snapshot comes from the same longshot_options.ini lines it writes
(audio_output_device_id). Every assertion is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
dev_runtime::tests::prepare_only_says_in_one_line_when_the_caches_stand wrote the stand-in program as `longshot-game`;
the step looks for play::game_program, `longshot-game.exe` on Windows, so there it said "base has no game program for
this system" and not that the caches stand. It is now written as game_layout::program_name_here(). The step and every
assertion are unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
game-files' nup::tests::a_package_reads_back extracts its package twice and asks the second to write nothing. Its
package has Case/Same.txt and Case/same.txt, two files on Linux, one on Windows' and macOS's file systems, which fold
case: there the folder holds the second's bytes, so the second extraction finds the first's size wrong and writes
both again. The check now reads which the file system gave, as the extraction left it, and expects those two there.

It still fails on Windows, for the next commit's reason: the second extraction finds 6 of the .zs files damaged where
one is (`left: (2, 6)`, `right: (2, 1)`).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When extract finds a package's .zs file already there whole, file_damaged checks it: its first four bytes by read_at
(the zstd magic), then the rest hashed through the file's own position. read_at is pread on Unix, which leaves the
position at the start; on Windows it is seek_read, which moves it, so the hash began at byte four and no good file
matched its package's SHA-256: every .zs file a second extraction checked was counted damaged.

The hash now starts from the file's start (rewind) on every system. nup::tests::a_package_reads_back's second
extraction finds the one damaged file again on Windows (it found 6) and passes; on Linux nothing changes.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
carry_saves copies a player's earlier saves into a folder of its own, then renames it to the profile's `saves`. When
something that is no folder is at that place, Linux's rename refuses the folder over it and the import fails, the
earlier saves left as they were to try again (play::tests::failed_import_keeps_source_and_can_retry). Windows' rename
replaced it: the file there was deleted, and the import said it was done. That check failed on Windows.

The import now refuses before the rename whatever is at the place and is not a folder (a file, or a link: Windows'
remove_dir would also have taken a link to a folder away), on every system, with the same error kind Linux's rename
gives (NotADirectory). Linux's behaviour is unchanged; the earlier saves are never touched.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A game folder's note keeps each file's stat, (size, write time, id), and an install links the base's file only while
it is still the one its note lists (folder.rs, "inode and all"); the same stat says a file the game folder has is
still the one put there. The id was the inode on Unix and 0 elsewhere, so on Windows only the size and the time told
files apart, and Windows' CopyFile keeps the time: a base file swapped for a copy (another file, the same bytes) was
still linked (folder::tests::an_install_with_a_base_links_the_files_that_are_the_bases failed on Windows).

stat_of now records Windows' file id there: the volume's serial and the 128-bit id, folded to one number by the new
build_core::fsx::file_key (0 where the file system gives none, as before). Every comparison goes through
folder::stat_matches, which compares the id only where the note has one: a note written before (id 0) is compared by
size and time as it was, so no game folder copies its files again after this update. Unix is unchanged (an inode is
never 0). The cost: one open of each file the install looks at, on Windows, for its id.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_present_sites.py's second program (HOS_PRESENT_NOWAIT=0) counts the renderer's status asks in `asked` and
never read it; clang 23 (llvm-mingw's, Windows) makes that an error (-Wunused-but-set-global), so the check failed to
compile there. It now checks what the count says: with the switch set, the poll never asks the renderer
(host/nvn_native.c: `e ? NULL : rx_status()`). Passes with clang and gcc.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_vsync_row.py defined unsetenv for Windows (_putenv_s), but neither its main nor the code it cuts from the
renderer calls it any more (mod-api's switches are settings), so the static function was unused and -Werror
(llvm-mingw's clang++) stopped the check. It is removed; every check is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_auto_handheld.py sets and clears SteamDeck around each case with setenv and unsetenv, which Windows' C
runtime does not have (g++ and clang++: 'setenv' was not declared). On Windows they are _putenv_s, an empty value
taking the variable away, as tests/test_present_sites.py's stand-in does; the detection reads it with getenv as
before. Every case is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_fs_path_utf8.py writes `<dir>\voice.bwav` and the like into `path`, as large as `dir` itself, and
gcc 15 (MSYS2's, the check's RUN_ALL_ARGS) makes the possible truncation an error (-Wformat-truncation). `path` is
now 32 bytes longer than `dir`, room for the longest leaf; the paths and every check are unchanged. Passes with gcc
and clang.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_builder_channel.py built only Linux's case (a SOCK_SEQPACKET socket pair, <sys/socket.h>) and declared no
skip, so on Windows it failed to compile. Windows' branch of host/builder_channel.c does work of its own: the builder
passes two pipe handles, which the claim makes not inheritable (nothing the game starts gets them) before taking the
variable out. The check now runs that on Windows: a real pipe whose handles are inheritable as the builder leaves
them, claimed (both no longer inheritable, the variable gone), handed over once; junk, one number and handles that
are not open refused. Linux's case is unchanged. Passes with gcc and clang.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/run_all.py gives its checks the checkout's tools/llvm-mingw (where `mise run tools` puts it) as LONGSHOT_MINGW
when the variable is unset; tests/test_run_all_mingw.py still made its stand-in compiler at the scratch clone's top,
llvm-mingw/, so on Windows run_all found none and test_the_clone_folder_when_the_variable_is_unset saw "<unset>". The
stand-in is now at tools/llvm-mingw/bin; every case and what each expects are unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
clang writes the compile's time into a COFF object's header (TimeDateStamp) unless told not to, so on Windows the
same source compiled a second apart made other bytes: the link already leaves its time out (/Brepro, reproducible),
the compiles did not. compile_link's a_lifted_unit_s_text_made_on_demand_compiles_to_its_file_s_object_and_is_kept_by_its_key,
which compares two compiles of one text byte for byte, failed whenever they fell in different seconds (bytes 4 to 7).

Every compile on the llvm-mingw route now takes -mno-incremental-linker-compatible (toolchain.rs's
reproducible_object, in Toolchain::target, which only compiles take; a Windows link takes native_target): the object's
stamp is 0. The new toolchain check compiles one source twice a second apart, the same bytes with it and other bytes
without; compile_link's unit takes it on Windows as the builder's compiles do. Linux is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows Python writes what goes to a pipe or a file in the ANSI code page (cp1252 and the like), which has no Δ,
≥ or the other characters the reports print: `dev.py ab`'s measurements, printed after they were written to
measurements.md, raised UnicodeEncodeError whenever its output was not a console (the job queue's log, a redirect,
tests/run_all.py: test_dev_ab's test_in_run_report_keeps_hitch_rates failed). devtools/common.py, which every dev.py
tool imports first, now makes a stdout or stderr that is no console write UTF-8 on Windows, as on Linux; a console
takes any character already and is left as it is.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
migrate holds every base for the move with a dev_packs.busy of its own and deletes each after; it read the marker
and deleted it inside the same with-block, the file still open, which Windows refuses (ERROR_SHARING_VIOLATION) and
the except swallowed: every base kept a busy marker, and dev.py packs then refused it as in use
(test_dev_migrate's test_rename and test_across_drives failed on Windows). The marker is closed first, as
packs.Busy's own __exit__ does.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
build.cmd_rt reads --re (the reverse-engineering build, #2924) with getattr(a, "re", False); test_dev_packs's rt checks
pass a mock.Mock, whose every attribute is a truthy Mock, so each built rt-<checkout>-re and test_rt_empty_is_a_copy
stopped at "--re or --empty, not both", on every system. The Mock now has re=False, as a command line without --re.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- test_dev_build: game_roots() joins ~ and Games with the system's separator, the check expected `~/Games`; and
  test_a_job_above_with_no_marker_left reads the processes above it, which are the PC's own, not the Linux the class
  plays (it found no /proc on Windows): common.WINDOWS is the real system's there.
- test_dev_update: a dump's folder is dirname(normpath(exefs)), `\d` on Windows: the check expects normpath("/d").
- test_dev_disk: the older dev.py's stores outside the development folder are under %LOCALAPPDATA%\Longshot on Windows,
  $XDG_CACHE_HOME on Linux; the check planted only Linux's, and left the PC's own LOCALAPPDATA read. It now has a
  LOCALAPPDATA of its own and plants the old store where this system's dev.py looks.
Every assertion is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_coverage_run.py asked for llvm-nm beside the compiler, which tools.lock's llvm-mingw (the one `mise run
tools` links, the builder compiles with) does not have, and failed. cover.py itself takes it from longshot-builder's
unpacked tools or the PATH; the check now takes the one beside the compiler, else the PATH's, and says so when neither
is there.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test_arguments_arrive_unchanged runs `mise run build` in a scratch project whose mise.toml had no tools, so the task's
python3 was the PATH's: on Windows that can be the Microsoft Store's alias, which is no Python ("Python was not
found"). The scratch mise.toml now pins the repository's own Python, read from its mise.toml, as the real task has it.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The gates start no game on Windows (the bridge's Unix socket, /proc), and main says so before anything else. Their A/B
checks stand in for the runs (launch, on_ram, catch_stops) and check the comparison, and the queue check checks the
queue's rules, both the same on every system, but on Windows they met that refusal first and failed. Each now stands in
for it too; a new check, test_run_refuses_on_windows, asks that the refusal itself holds, on every system.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- mod_calls_the_hook_with_a_context_and_its_status: the profile is made whole, `C:\p\ann` on Windows: expected
  as std::path::absolute gives it.
- recomplauncher_s_build_step_is_a_command_line_it_takes: recomplauncher.json's paths have `/` on every system;
  game_folder's are the system's: compared with `/`.
- a_build_for_a_profile_writes_profile_json_and_its_settings and play's scratch folders: made whole, as the code makes
  the paths it compares (Windows' absolute resolves the `..` in them, Unix's keeps it).
- no_gpu_reads_as_the_game_s_header_does: Linux's sysfs, whose PCI slots (`0000:01:00.0`) no Windows folder may be
  named: #[cfg(unix)].
What each returns is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_fs_path_utf8.py's program took the folder it makes its long path in from argv, which Windows gives in the
ANSI code page: a temporary folder with a letter outside it (a user name such as Jörg's, in a code page without ö)
came as no UTF-8, the form the game's paths and fs_wide take, and the check failed. It takes the folder from the
command line Windows keeps in Unicode (CommandLineToArgvW, shellapi.h, -lshell32), as UTF-8. Checked with gcc and clang,
and from a temporary folder named "Lö ngshot tmp".

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
cover.py run needs llvm-nm, which tools.lock's llvm-mingw does not have: on a PC with no other the check could not
pass and failed outright, where run_all.py's rule for a tool not on the PC is a skip (a failure only with --strict).
run_all.py now finds llvm_nm as it finds llvm_mc (LLVM_NM, else the PATH's), and the check takes it from there: no
llvm-nm, skipped. It also read cover.bin.log as ASCII, which the DLL writes with the run's paths in the ANSI code page:
a folder whose path holds a letter outside ASCII raised UnicodeDecodeError. Read with those letters replaced; what it
checks is ASCII.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
link::tests::the_output_is_not_an_input_whatever_its_path_holds: a link whose output exists (the last link's) and an
ordering file inside an option; the inputs must be the ordering file alone. It fails on mod-api on Windows: link_inputs
looks for a file after an argument's first ':' or '=', and a whole path's drive (C:/w/x.exe) gives /w/x.exe, the
output itself under another name, which then is in the link's key and changes it at each link.

tests/compile_link.rs's program is prog.exe on Windows, the file the link writes (it linked prog, and link::run
looked for prog): an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches then fails on Windows
for the same reason ("and links nothing").

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
link_inputs looks for a file inside an option, after its first ':' or '='. A whole Windows path's drive was taken for
one: `-o C:\...\longshot-game.exe` gave `\...\longshot-game.exe`, the last link's output under another name, which
went into the link's key, so the key changed at each link and every link ran again: an unchanged pack still linked
the game (911 MB, 5 s) and the renderer. option_value now takes the first '=' or a ':' that is not a drive's (a
letter alone before it, a separator after it): `/map:C:/x` still gives `C:/x`. Linux's paths hold no drive: unchanged.

main's #2872 (now in mod-api) skips the argument that is the output itself before this parse; this takes a drive's
colon for no separator in every argument, so no other path a link names is cut at its drive either: compile_link's
an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches still linked again on Windows with #2872
alone, and passes with this.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_run_all_declarations.py keeps run_all.py's find_tools names in TOOLS; llvm_nm (the coverage run's llvm-nm,
two commits ago) was not there, so test_placeholders_are_find_tools failed and test_coverage_run.py's declaration was
taken for an unknown placeholder, on every system. Added.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
hos_cores (main's #2876, in mod-api) asks Windows for its logical processors with GetActiveProcessorCount and other
systems with sysconf; tests/test_host_cores_auto.py stood in for sysconf alone, so on Windows the cut did not compile
(GetActiveProcessorCount, ALL_PROCESSOR_GROUPS undeclared; _SC_NPROCESSORS_ONLN is not Windows'). On Windows the check
now stands in for GetActiveProcessorCount, fed the same count, so each case checks Windows' branch there: 8 of 8 with
gcc and clang, and it fails with that branch's threshold changed (16 logical processors giving 6). Linux is unchanged.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_profile_symbols.py compiles profiling.c's Linux symbols writer, which reads the renderer's ELF (elf.h, .so
modules, nm), and left it out only where gcc, g++ or nm were missing: on Windows with MSYS2's gcc it tried and failed
to compile. profiling.c reads Windows' symbols from the linker map instead; the compiled part is left out on Windows
as it is where its tools are missing, and the source checks run as before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
toolchain's a_windows_object_of_the_same_source_is_the_same_bytes also asked that two compiles without the option
differ. llvm-mingw's clang writes the compile's time into a COFF object by default; Linux's clang compiling for
x86_64-w64-mingw32 does not, so on Linux the check failed though the option did its work. It now asks what the option
gives on any clang: the same bytes a second apart, and the COFF header's TimeDateStamp zero. Passes on Windows; with
the option changed for another, it fails.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Windows' CreateFileW gives every handle FILE_READ_ATTRIBUTES (and SYNCHRONIZE) beside what was asked. Rust's
std::fs::metadata, is_dir and is_file open with access 0 and read the attributes by the handle. The file service gives
the confined game only SYNCHRONIZE and the access it asked, so each of those calls on a file or folder the builder serves
fails with ERROR_ACCESS_DENIED: the save list's search (save_start::newest_save) finds no folder, and `dev.py smoke`
stays on the title screen with "skip title: there is no saved game".

Fails here: "game: Err(Os { code: 5, kind: PermissionDenied, message: "Access is denied." })".

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Windows' CreateFileW gives every handle FILE_READ_ATTRIBUTES and SYNCHRONIZE beside what was asked; the file service gave
the confined game only what it asked (and SYNCHRONIZE), so Rust's std::fs::metadata (access 0, then the attributes by the
handle) failed on every file and folder the builder serves: the save list found no save, and a run never left the title
screen for its save. The handle given now carries FILE_READ_ATTRIBUTES too. The rules decide on what was asked, as before;
a STAT already tells the attributes of any path they let the game open, so the handle reads nothing more than that.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fake game writes a shot only in its user folder's temp/ on every system, as the sandbox lets a confined game; on
Windows the clients asked it to write the path itself (a pipe has no folder to stage beside), which a confined game
cannot: `dev.py smoke` fails there with "the PNG could not be written to ...\menu.png". The staged shot's take is
checked on Windows: a link left in temp/ is not read through (longshot_bridge.take_shot, and the builder's `mod shot`).

Fails here: test_longshot_ctl's ShotStaging (write_failed; a link read through) and Sessions' recorded shot;
modtool's windows_tests::a_staged_link_is_not_taken.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows the clients (longshot_bridge.py, Longshot.exe mod shot) asked the game to write a shot's path itself, a pipe
having no folder to stage beside; a confined game writes no path the client names, so every shot to a path failed
("the PNG could not be written"), dev.py smoke's menu shot among them. A shot to a path is now staged in the game's
temp/ on Windows as on Linux and moved by the client. The take reads through no link on Windows too: Rust opens the
link itself (FILE_FLAG_OPEN_REPARSE_POINT), whose metadata is no plain file; Python checks the name is no reparse point
and the file opened is the one it looked at. With no path, the game writes its own default, as before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(dev): on Windows, run the confined game from a shell outside a packaged app
All checks were successful
PR description / Title and description (pull_request_target) Successful in 5s
5b5e238efa
A Store (MSIX) app that keeps AppData virtualized, the Claude desktop app among them, has its processes' writes under
%LOCALAPPDATA% and %APPDATA% put in a copy of its own, and the tools it starts inherit that; the confined game, in the
sandbox's container, sees the real folders. So a run folder the tools made is not there for it (dev.py smoke stayed on
the title screen, "skip title: there is no saved game"), nor a shot it staged for them. Found running mod-api's smoke
from the Claude desktop app; the same run from a terminal outside the package passed.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11 Pro (26300), RTX 5080 (NVIDIA 621.40): dev.py smoke PASS, confined in the AppContainer, from kokiri-start: in play, 900 frames, the Insert menu open with its page (system/menu), the bridge's shot staged in the game's temp\ and moved; no FATAL, every system mod started. Without these fixes the same run stayed on the title screen (skip title: there is no saved game), then failed its shot. A windowed run showed the Insert menu over the game.

Tested in game: Windows 11 Pro (26300), RTX 5080 (NVIDIA 621.40): dev.py smoke PASS, confined in the AppContainer, from kokiri-start: in play, 900 frames, the Insert menu open with its page (system/menu), the bridge's shot staged in the game's temp\ and moved; no FATAL, every system mod started. Without these fixes the same run stayed on the title screen (skip title: there is no saved game), then failed its shot. A windowed run showed the Insert menu over the game.
Member

Possibly related, for context:

  • PR #2726 fix(sandbox): Windows: a sandboxed start with a profile reaches play, its saves and the test mode's results written — Windows profile start and broker file-service fixes overlap carried fixes
  • PR #2747 fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder — Windows sandboxed mod-test startup and file access
Possibly related, for context: - PR #2726 fix(sandbox): Windows: a sandboxed start with a profile reaches play, its saves and the test mode's results written — Windows profile start and broker file-service fixes overlap carried fixes - PR #2747 fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder — Windows sandboxed mod-test startup and file access
llun changed title from WIP: fix: mod-api on Windows: every fix its Windows tests turned up, in one pull request to fix: mod-api on Windows: every fix its Windows tests turned up, in one pull request 2026-12-01 06:44:27 +00:00
BeanBot left a comment

Recommendation: Request changes. Existing Windows installation notes continue to accept a replaced base file, so a runtime can still receive the wrong file. The user-folder migration also still fails when an older folder contains a read-only file.

The pull request fixes several Windows sandbox, build, mod and screenshot failures, with a reported confined game run on NVIDIA hardware. It also adds file-identity checks and changes compiler flags, but the identity check does not protect existing notes and the migration does not handle read-only files.

Blocking (1): must change before merging.

  1. L1 builder/crates/build-driver/src/folder.rs:154: A note with file ID zero continues to match solely by size and time, and kept entries are never upgraded to a file ID. (more on the line) Do: Validate old zero-ID entries against their recorded hash before trusting them, then write their current file IDs into the note, including entries kept without staging.

Should fix (1): not blocking, but worth doing before merging.

  • L2 builder/crates/build-core/src/user_folder.rs:252: The copied file retains its read-only attribute, so reopening it with write access to flush it fails on Windows. (more on the line) Do: Copy through a writable handle and flush before restoring the source permissions, or otherwise make the staged copy writable for the flush and restore its attribute afterward.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 scripts/longshot_bridge.py:251: The changed screenshot client has not been exercised in a confined Linux game run. (more on the line) Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.
  • L4 builder/crates/build-compile/src/toolchain.rs:291: The Windows compiler flag change has no reported clean or incremental build-time comparison. (more on the line) Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.

@fix can do L1 and L2.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • Were the remaining changed files and tests reviewed in full by another reviewer? This inspection did not cover them completely.
More: does it help, other systems, switches, what was read

Does it help: Yes for the tested sandbox and screenshot failures: the author reports a confined Windows run reaching play and taking a staged screenshot, where the base stayed at the title screen and then failed the screenshot. The other fixes are supported by reported game-free checks; clean and incremental build-time effects of the compiler flag change are not reported.

Other systems: The screenshot clients also changed on Linux; a confined Linux game run remains outstanding. Windows AMD and Intel runs and a Windows account without symbolic-link privileges are also outstanding. The file-identity change affects existing Windows game-folder notes and runtime hard links.

Switches: No production switch added or changed. LONGSHOT_NO_CLANG is an existing test variable.

Reviewed: 5b5e238efa against 5740a5dff9: Read repository instructions, CONTRIBUTING.md, standards and the pull request template; inspected the diff for the sandbox, migration, file identity, screenshot, loader and menu changes and their relevant surrounding code. The full 79-file change, translations, generated-file claims and all changed tests were not read in full; the combined diff and commit-log output were truncated.; nothing run (a code review).

Checked and fine:

  • The reported Windows confined run exercised the save-list and staged-screenshot fixes.
  • The renderer API header and third_party files are not in the changed-file list.
  • The supplied CI record reports no head-only failures.

Testing: Read-only review; no build, test, script or game run was executed.

Overlaps and merge order: The description identifies eleven carried-over pull requests that are to close in favor of this one; their current Forgejo state could not be checked offline.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as llun took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Existing Windows installation notes continue to accept a replaced base file, so a runtime can still receive the wrong file. The user-folder migration also still fails when an older folder contains a read-only file. The pull request fixes several Windows sandbox, build, mod and screenshot failures, with a reported confined game run on NVIDIA hardware. It also adds file-identity checks and changes compiler flags, but the identity check does not protect existing notes and the migration does not handle read-only files. **Blocking (1)**: must change before merging. 1. **L1** `builder/crates/build-driver/src/folder.rs:154`: A note with file ID zero continues to match solely by size and time, and kept entries are never upgraded to a file ID. (more on the line) **Do:** Validate old zero-ID entries against their recorded hash before trusting them, then write their current file IDs into the note, including entries kept without staging. **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `builder/crates/build-core/src/user_folder.rs:252`: The copied file retains its read-only attribute, so reopening it with write access to flush it fails on Windows. (more on the line) **Do:** Copy through a writable handle and flush before restoring the source permissions, or otherwise make the staged copy writable for the flush and restore its attribute afterward. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `scripts/longshot_bridge.py:251`: The changed screenshot client has not been exercised in a confined Linux game run. (more on the line) **Do:** Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination. - **L4** `builder/crates/build-compile/src/toolchain.rs:291`: The Windows compiler flag change has no reported clean or incremental build-time comparison. (more on the line) **Do:** Compare clean build time and size and a one-function rebuild against the base on the same Windows machine. `@fix` can do L1 and L2. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - Were the remaining changed files and tests reviewed in full by another reviewer? This inspection did not cover them completely. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the tested sandbox and screenshot failures: the author reports a confined Windows run reaching play and taking a staged screenshot, where the base stayed at the title screen and then failed the screenshot. The other fixes are supported by reported game-free checks; clean and incremental build-time effects of the compiler flag change are not reported. **Other systems:** The screenshot clients also changed on Linux; a confined Linux game run remains outstanding. Windows AMD and Intel runs and a Windows account without symbolic-link privileges are also outstanding. The file-identity change affects existing Windows game-folder notes and runtime hard links. **Switches:** No production switch added or changed. LONGSHOT_NO_CLANG is an existing test variable. **Reviewed:** 5b5e238efaab against 5740a5dff926: Read repository instructions, CONTRIBUTING.md, standards and the pull request template; inspected the diff for the sandbox, migration, file identity, screenshot, loader and menu changes and their relevant surrounding code. The full 79-file change, translations, generated-file claims and all changed tests were not read in full; the combined diff and commit-log output were truncated.; nothing run (a code review). **Checked and fine:** - The reported Windows confined run exercised the save-list and staged-screenshot fixes. - The renderer API header and third_party files are not in the changed-file list. - The supplied CI record reports no head-only failures. **Testing:** Read-only review; no build, test, script or game run was executed. **Overlaps and merge order:** The description identifies eleven carried-over pull requests that are to close in favor of this one; their current Forgejo state could not be checked offline. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as llun took it out of WIP. Nothing was run; a maintainer decides.</sub>
@ -287,2 +288,4 @@
};
let mut target = native_target.clone();
if mingw.is_some() {
target.push(reproducible_object());
Member

L4 (should fix): The Windows compiler flag change has no reported clean or incremental build-time comparison.

When: Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown.

Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.

**L4** (should fix): The Windows compiler flag change has no reported clean or incremental build-time comparison. *When:* Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown. **Do:** Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.
@ -250,1 +250,3 @@
return copied && std::fs::File::open(to).and_then(|f| f.sync_all()).is_ok();
// (Windows flushes a file only through a handle that may write it: FlushFileBuffers)
let flushed = || std::fs::OpenOptions::new().read(true).write(cfg!(windows)).open(to)?.sync_all();
return copied && flushed().is_ok();
Member

L2 (should fix): The copied file retains its read-only attribute, so reopening it with write access to flush it fails on Windows.

When: If an older user folder contains a read-only save or other file, copy succeeds but the write-enabled open fails; settle keeps the old folder and retries the migration on later starts.

Do: Copy through a writable handle and flush before restoring the source permissions, or otherwise make the staged copy writable for the flush and restore its attribute afterward.

**L2** (should fix): The copied file retains its read-only attribute, so reopening it with write access to flush it fails on Windows. *When:* If an older user folder contains a read-only save or other file, copy succeeds but the write-enabled open fails; settle keeps the old folder and retries the migration on later starts. **Do:** Copy through a writable handle and flush before restoring the source permissions, or otherwise make the staged copy writable for the flush and restore its attribute afterward.
@ -145,0 +151,4 @@
/// game folder copies its files again for it.
pub(crate) fn stat_matches(noted: (u64, u128, u64), now: Option<(u64, u128, u64)>) -> bool {
now.is_some_and(|n| n.0 == noted.0 && n.1 == noted.1 && (noted.2 == 0 || n.2 == noted.2))
}
Member

L1 (blocking): A note with file ID zero continues to match solely by size and time, and kept entries are never upgraded to a file ID.

When: On Windows, a base created before this change has an ID of zero in its note. If one of its files is replaced by a different file with the same size and timestamp, install accepts that note and hard-links the replacement into a new runtime; subsequent unchanged installs retain the zero-ID note.

Do: Validate old zero-ID entries against their recorded hash before trusting them, then write their current file IDs into the note, including entries kept without staging.

**L1** (blocking): A note with file ID zero continues to match solely by size and time, and kept entries are never upgraded to a file ID. *When:* On Windows, a base created before this change has an ID of zero in its note. If one of its files is replaced by a different file with the same size and timestamp, install accepts that note and hard-links the replacement into a new runtime; subsequent unchanged installs retain the zero-ID note. **Do:** Validate old zero-ID entries against their recorded hash before trusting them, then write their current file IDs into the note, including entries kept without staging.
@ -238,2 +249,3 @@
# and moved here to the path asked, or shots/ beside the socket, by the client, which may write it)
# and moved here to the path asked, or shots/ beside the socket, by the client, which may write it; on Windows,
# a pipe with no folder, a shot to a path)
stage = want = None
Member

L3 (should fix): The changed screenshot client has not been exercised in a confined Linux game run.

When: A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path.

Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.

**L3** (should fix): The changed screenshot client has not been exercised in a confined Linux game run. *When:* A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path. **Do:** Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.
Windows' copy keeps a file's read-only attribute, and the move flushes each copy through a handle that may write it
(FlushFileBuffers): a read-only save, or any read-only file of the older folder, could not be flushed, so the move kept
the old folder and was tried again at every start. Found by BeanBot's review of #2938 (L2).

Fails here: "saves: 3 entries of ...\game/user could not go to ...\data/longshot: the saves stay in ...".

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The move flushes each copy through a handle that may write it (Windows' FlushFileBuffers needs one), and Windows' copy
keeps a file's read-only attribute, so a read-only file could not be flushed and the whole move was kept back, tried
again at every start. Such a copy is made writable for the flush, then read-only again. Found by BeanBot's review of
#2938 (L2).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A note written before Windows' file ids were recorded has 0 there and was compared by size and time alone, so a file
swapped for another of the same size and time (Windows' copy keeps the time) was still taken for the noted one: kept, the
builder's, and hard-linked into a runtime made from that base. And a kept entry never got its id. Found by BeanBot's
review of #2938 (L1).

Fails here: "only the noted bytes are the builder's".

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): a game folder's note from before file ids is checked by its bytes and given the id
Some checks failed
beanstalk/approval can't be tested as asked: see the farm's comment
PR description / Title and description (pull_request_target) Successful in 7s
319bdf5e0b
A note written before Windows' file ids were recorded (id 0) was compared by size and time alone, so a file swapped for
another of the same size and time (Windows' copy keeps the time) was taken for the noted one: kept by an install, taken
as the builder's to replace or remove, and hard-linked from a base into a runtime. Such an entry is now taken only when
its bytes are its SHA-256 too, read once (`still_noted`, everywhere a note's stat is trusted), and the install that keeps
it notes the file's id, so it is read no more. A note with ids is compared as before. Found by BeanBot's review of #2938
(L1).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks. Answered at 319bdf5e:

  • L1 (folder.rs): fixed, test first (8c97104e, then 319bdf5e). A note entry with id 0 is now taken only when the file's bytes are its SHA-256 too, read once (still_noted, everywhere a note's stat is trusted: owned, an install's kept check, the base's link check, dev_runtime's base check), and the install that keeps it writes the file's id into the note. The test swaps a file for another of the same size and time under an id-0 note: not the builder's, not linked into a runtime, copied over; every entry has its id after. With the hash check taken out it fails again. A note with ids is compared as before.
  • L2 (user_folder.rs): fixed, test first (a5e90860, then 67afe81d). A read-only copy is made writable for its flush, then read-only again; the test's read-only save moves and stays read-only. Before, the move was kept back as you said: "saves: 3 entries of ... could not go to ...".
  • L3: listed under Still to test for the Test Farm (@Beanstalk dev.py smoke on Linux, confined); there's no Linux PC here.
  • L4: tools.lock's llvm-mingw clang, the 31 host C files that compile alone, -O2, without and with the flag, through the queue. The objects are the same bytes but for the COFF header's 4-byte time (335,411 bytes both ways), and one file's compile is 301 ms without, 279 ms with. The whole set's times were noise on this PC today (other builds running: 9 to 34 s a round, no order by the flag), so a clean build-time comparison on a quiet PC is still to do, by hand.
  • Question: no other reviewer has read the whole change. The eleven pull requests it carries were reviewed one at a time; the new commits each stand on their own test.

On the related pull requests: #2726's files_windows fix (the broker opening with FILE_READ_ATTRIBUTES, and the game's handle having it) is the same as this one's two, found separately; the rest of #2726 and #2747 is in mod-api now through #2898 (the test mode's folder in the plan, its results folder, the save folder from the builder's hello). Both are on mod-api from before its re-squash.

Also new in the description: on Linux, dev_runtime's copy test fails now and then with the whole crate beside it, on mod-api too (game_folder_busy): not this change's, named under Risks.

Thanks. Answered at 319bdf5e: - **L1** (`folder.rs`): fixed, test first (8c97104e, then 319bdf5e). A note entry with id 0 is now taken only when the file's bytes are its SHA-256 too, read once (`still_noted`, everywhere a note's stat is trusted: `owned`, an install's kept check, the base's link check, `dev_runtime`'s base check), and the install that keeps it writes the file's id into the note. The test swaps a file for another of the same size and time under an id-0 note: not the builder's, not linked into a runtime, copied over; every entry has its id after. With the hash check taken out it fails again. A note with ids is compared as before. - **L2** (`user_folder.rs`): fixed, test first (a5e90860, then 67afe81d). A read-only copy is made writable for its flush, then read-only again; the test's read-only save moves and stays read-only. Before, the move was kept back as you said: "saves: 3 entries of ... could not go to ...". - **L3**: listed under Still to test for the Test Farm (`@Beanstalk dev.py smoke on Linux, confined`); there's no Linux PC here. - **L4**: tools.lock's llvm-mingw clang, the 31 host C files that compile alone, -O2, without and with the flag, through the queue. The objects are the same bytes but for the COFF header's 4-byte time (335,411 bytes both ways), and one file's compile is 301 ms without, 279 ms with. The whole set's times were noise on this PC today (other builds running: 9 to 34 s a round, no order by the flag), so a clean build-time comparison on a quiet PC is still to do, by hand. - **Question**: no other reviewer has read the whole change. The eleven pull requests it carries were reviewed one at a time; the new commits each stand on their own test. On the related pull requests: #2726's `files_windows` fix (the broker opening with `FILE_READ_ATTRIBUTES`, and the game's handle having it) is the same as this one's two, found separately; the rest of #2726 and #2747 is in `mod-api` now through #2898 (the test mode's folder in the plan, its results folder, the save folder from the builder's hello). Both are on `mod-api` from before its re-squash. Also new in the description: on Linux, `dev_runtime`'s copy test fails now and then with the whole crate beside it, on `mod-api` too (`game_folder_busy`): not this change's, named under Risks.
Member

Beanstalk test farm

Commit e2d9c75 · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `e2d9c75` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2938) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The two code fixes address the reported cases. A confined Linux screenshot run and a clean Windows build-time comparison remain outstanding. Recommend approval; not approved on the forge.

The pull request fixes Windows build, sandbox, save migration, mod and screenshot problems. The review fixes validate older file notes before trusting them and allow read-only files to be copied during migration, at the cost of hashing older noted files once.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 scripts/longshot_bridge.py:251: The changed screenshot client has not been exercised in a confined Linux game run. When: A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path. Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.
  • L4 builder/crates/build-compile/src/toolchain.rs:291: The Windows compiler flag change has no reported clean or incremental build-time comparison. When: Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown. Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.

Since the last review (on 5b5e238efa)
Resolved: L1 (A note with file ID zero continues to match solely by size and time, and kept entries are…); L2 (The copied file retains its read-only attribute, so reopening it with write access to flus…)
Still open: L3 (The changed screenshot client has not been exercised in a confined Linux game run.); L4 (The Windows compiler flag change has no reported clean or incremental build-time compariso…)

Also noticed (2; not asked for, not blocking)
  • A file system that supplies no file ID still leaves a zero-ID note matched by size and time.
  • A read-only original can remain in the old user folder after migration because Windows may refuse to delete it.
More: does it help, other systems, switches, what was read

Does it help: Yes for the reported Windows failures: the author reports a confined game smoke run passing after the sandbox and screenshot fixes, where it previously stopped at the title screen or failed its screenshot. The compiler flag's build-time effect remains unmeasured on a quiet PC.

Other systems: The screenshot client also changes Linux behavior; a confined Linux game run remains outstanding. The reported Windows game run used NVIDIA; AMD and Intel runs are listed as outstanding. The note and migration fixes have reported Windows and Linux crate tests.

Switches: No switches added, changed or removed. LONGSHOT_NO_CLANG is an existing test variable.

Reviewed: 319bdf5e0b against 5740a5dff9: Read AGENTS.md, CONTRIBUTING.md, the changes since the ledger and user_folder.rs; inspected the affected note callers and portions of folder.rs, dev_runtime.rs, toolchain.rs and longshot_bridge.py. The full pull request diff and remaining changed files were not read in full.; nothing run (a code review).

Checked and fine:

  • The zero-ID check is applied to the staged hard link as well as the kept destination.
  • The migration restores the copied file's read-only attribute even when opening or flushing it fails.

Testing: No commands from the project or tests were run. The author reports Windows build-driver and user-folder tests, Linux build-driver tests, and a Windows confined game smoke run; the Linux confined screenshot run and quiet build-time comparison remain outstanding.

Overlaps and merge order: The description identifies eleven carried-over pull requests to close in favor of this one; the author says the file-service fixes overlap #2726, with the remainder of #2726 and #2747 already in mod-api through #2898.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The two code fixes address the reported cases. A confined Linux screenshot run and a clean Windows build-time comparison remain outstanding. Recommend approval; not approved on the forge. The pull request fixes Windows build, sandbox, save migration, mod and screenshot problems. The review fixes validate older file notes before trusting them and allow read-only files to be copied during migration, at the cost of hashing older noted files once. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `scripts/longshot_bridge.py:251`: The changed screenshot client has not been exercised in a confined Linux game run. *When:* A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path. **Do:** Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination. - **L4** `builder/crates/build-compile/src/toolchain.rs:291`: The Windows compiler flag change has no reported clean or incremental build-time comparison. *When:* Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown. **Do:** Compare clean build time and size and a one-function rebuild against the base on the same Windows machine. **Since the last review** (on 5b5e238efaab) Resolved: L1 (A note with file ID zero continues to match solely by size and time, and kept entries are…); L2 (The copied file retains its read-only attribute, so reopening it with write access to flus…) Still open: L3 (The changed screenshot client has not been exercised in a confined Linux game run.); L4 (The Windows compiler flag change has no reported clean or incremental build-time compariso…) <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - A file system that supplies no file ID still leaves a zero-ID note matched by size and time. - A read-only original can remain in the old user folder after migration because Windows may refuse to delete it. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported Windows failures: the author reports a confined game smoke run passing after the sandbox and screenshot fixes, where it previously stopped at the title screen or failed its screenshot. The compiler flag's build-time effect remains unmeasured on a quiet PC. **Other systems:** The screenshot client also changes Linux behavior; a confined Linux game run remains outstanding. The reported Windows game run used NVIDIA; AMD and Intel runs are listed as outstanding. The note and migration fixes have reported Windows and Linux crate tests. **Switches:** No switches added, changed or removed. LONGSHOT_NO_CLANG is an existing test variable. **Reviewed:** 319bdf5e0b11 against 5740a5dff926: Read AGENTS.md, CONTRIBUTING.md, the changes since the ledger and user_folder.rs; inspected the affected note callers and portions of folder.rs, dev_runtime.rs, toolchain.rs and longshot_bridge.py. The full pull request diff and remaining changed files were not read in full.; nothing run (a code review). **Checked and fine:** - The zero-ID check is applied to the staged hard link as well as the kept destination. - The migration restores the copied file's read-only attribute even when opening or flushing it fails. **Testing:** No commands from the project or tests were run. The author reports Windows build-driver and user-folder tests, Linux build-driver tests, and a Windows confined game smoke run; the Linux confined screenshot run and quiet build-time comparison remain outstanding. **Overlaps and merge order:** The description identifies eleven carried-over pull requests to close in favor of this one; the author says the file-service fixes overlap #2726, with the remainder of #2726 and #2747 already in mod-api through #2898. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Author
Member

On the two things the re-review noticed:

  • A drive with no file ids (FAT32 or exFAT, some network shares): its game folder's note has no id to record, so its entries are compared by size and time alone, as mod-api compares them now. No change from mod-api there, and nothing new broken. It matters only if a different file of the same size and time is put in such a game folder; a build after it changes or removes it puts it right. Hashing every file at every build on those drives would close it, at a cost each build, so it is named under Risks and not done.
  • A read-only original left in the old user folder: not on NTFS. user_folder's an_older_folder_s_read_only_file_moves_with_it checks the old folder's saves are gone after the move (whole_in), and it passes on Windows: Rust's remove_dir_all deletes a read-only file there. Not checked on a FAT32 or exFAT drive; there, at worst, a copy would stay in the old place, the saves already in the new one and used from it.
On the two things the re-review noticed: - **A drive with no file ids** (FAT32 or exFAT, some network shares): its game folder's note has no id to record, so its entries are compared by size and time alone, as `mod-api` compares them now. No change from `mod-api` there, and nothing new broken. It matters only if a different file of the same size and time is put in such a game folder; a build after it changes or removes it puts it right. Hashing every file at every build on those drives would close it, at a cost each build, so it is named under Risks and not done. - **A read-only original left in the old user folder**: not on NTFS. `user_folder`'s `an_older_folder_s_read_only_file_moves_with_it` checks the old folder's saves are gone after the move (`whole_in`), and it passes on Windows: Rust's `remove_dir_all` deletes a read-only file there. Not checked on a FAT32 or exFAT drive; there, at worst, a copy would stay in the old place, the saves already in the new one and used from it.
test(bridge): the Windows shot take's check runs its plain file first, so an account without links still runs it
Some checks are pending
PR description / Title and description (pull_request_target) Successful in 8s
beanstalk/approval not approved yet
e2d9c75a20
modtool's windows_tests returned at a symbolic link it could not make (a Windows account without the right to, no
Developer Mode) before its plain file's take, so that account ran neither. The plain file is taken first; only the
link's half is skipped there, with the reason said.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested: a Windows account that may not make symbolic links (it was under Still to test).

This PC's account makes links only through Developer Mode (it has no SeCreateSymbolicLinkPrivilege), so each link step was made to fail as Windows fails it for an account without the right, ERROR_PRIVILEGE_NOT_HELD (1314):

  • test_longshot_ctl.py's ShotStaging, with os.symlink raising WinError 1314: the two session tests pass; the link test is skipped saying why (no symbolic link can be made here: [WinError 1314] A required privilege is not held by the client), its plain take and staged_at checks before the skip passing.
  • modtool's windows_tests::a_staged_link_is_not_taken, with the link's creation returning error 1314 (a local edit, not committed): the plain file is taken, then skipped: no symbolic link can be made here: A required privilege is not held by the client. (os error 1314). Before e2d9c75a this test returned at the link before its plain file, so such an account ran neither half; it now takes the plain file first.

Not run from a real account without the right; the description's Testing says so.

Tested: a Windows account that may not make symbolic links (it was under Still to test). This PC's account makes links only through Developer Mode (it has no `SeCreateSymbolicLinkPrivilege`), so each link step was made to fail as Windows fails it for an account without the right, `ERROR_PRIVILEGE_NOT_HELD` (1314): - `test_longshot_ctl.py`'s `ShotStaging`, with `os.symlink` raising `WinError 1314`: the two session tests pass; the link test is skipped saying why (`no symbolic link can be made here: [WinError 1314] A required privilege is not held by the client`), its plain take and `staged_at` checks before the skip passing. - `modtool`'s `windows_tests::a_staged_link_is_not_taken`, with the link's creation returning error 1314 (a local edit, not committed): the plain file is taken, then `skipped: no symbolic link can be made here: A required privilege is not held by the client. (os error 1314)`. Before e2d9c75a this test returned at the link before its plain file, so such an account ran neither half; it now takes the plain file first. Not run from a real account without the right; the description's Testing says so.
Author
Member
@review
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The Windows fixes have reported game and game-free coverage, but the changed screenshot client still needs a confined Linux game run, and the compiler flag still needs a clean build-time comparison. Recommend approval; not approved on the forge.

The pull request fixes Windows installation, sandbox, mod, screenshot and menu problems. The latest change lets the Windows screenshot test exercise a plain file even when the account cannot create symbolic links.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 scripts/longshot_bridge.py:251: The changed screenshot client has not been exercised in a confined Linux game run. When: A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path. Do: Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination.
  • L4 builder/crates/build-compile/src/toolchain.rs:291: The Windows compiler flag change has no reported clean or incremental build-time comparison. When: Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown. Do: Compare clean build time and size and a one-function rebuild against the base on the same Windows machine.

Since the last review (on 319bdf5e0b)
Still open: L3 (The changed screenshot client has not been exercised in a confined Linux game run.); L4 (The Windows compiler flag change has no reported clean or incremental build-time compariso…)

More: does it help, other systems, switches, what was read

Does it help: Yes for the reported Windows smoke case: the confined run reached play and saved a staged screenshot, whereas the base stayed on the title screen or failed the shot. The compiler flag's build-time effect remains unproven; reported whole-set timings were noisy.

Other systems: The screenshot client also runs on Linux; its confined game path has not yet been exercised. Windows game coverage was reported on NVIDIA, with AMD and Intel runs requested. The compiler flag applies to llvm-mingw builds.

Switches: No switch added or changed; LONGSHOT_NO_CLANG is an existing test variable.

Reviewed: e2d9c75a20 against 5740a5dff9: Read the change since the ledger, the surrounding Windows test and screenshot-taking code, and the relevant bridge and compiler-flag sections. Read AGENTS.md, CONTRIBUTING.md and the pull request template; the review checklist was absent. Skimmed the overall diff stat and reported runs; the other changed files were not read in full during this re-check.; nothing run (a code review).

Checked and fine:

  • The Windows test takes and removes the plain staged file before attempting to create a symbolic link, so the plain-file check runs when link creation is unavailable.
  • The reported Windows smoke run exercised the confined game and staged screenshot path.

Testing: No commands that build, execute project code or run tests were run. The author reports Windows smoke and game-free checks; the confined Linux smoke and quiet Windows build-time comparison remain outstanding.

Overlaps and merge order: The description says the carried pull requests close in favour of this one; #2726 overlaps the Windows file-service fixes, and #2898 covers the excluded fixes.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The Windows fixes have reported game and game-free coverage, but the changed screenshot client still needs a confined Linux game run, and the compiler flag still needs a clean build-time comparison. Recommend approval; not approved on the forge. The pull request fixes Windows installation, sandbox, mod, screenshot and menu problems. The latest change lets the Windows screenshot test exercise a plain file even when the account cannot create symbolic links. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `scripts/longshot_bridge.py:251`: The changed screenshot client has not been exercised in a confined Linux game run. *When:* A Linux player requests a screenshot through the bridge while the game is confined; the reported Windows run does not exercise Linux's socket and file-access path. **Do:** Run the requested confined Linux smoke test from a save, open the menu and verify that the staged screenshot reaches its requested destination. - **L4** `builder/crates/build-compile/src/toolchain.rs:291`: The Windows compiler flag change has no reported clean or incremental build-time comparison. *When:* Windows builds now pass the reproducible-object flag to every llvm-mingw compile; its effect on a clean build and a one-function rebuild is unknown. **Do:** Compare clean build time and size and a one-function rebuild against the base on the same Windows machine. **Since the last review** (on 319bdf5e0b11) Still open: L3 (The changed screenshot client has not been exercised in a confined Linux game run.); L4 (The Windows compiler flag change has no reported clean or incremental build-time compariso…) <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported Windows smoke case: the confined run reached play and saved a staged screenshot, whereas the base stayed on the title screen or failed the shot. The compiler flag's build-time effect remains unproven; reported whole-set timings were noisy. **Other systems:** The screenshot client also runs on Linux; its confined game path has not yet been exercised. Windows game coverage was reported on NVIDIA, with AMD and Intel runs requested. The compiler flag applies to llvm-mingw builds. **Switches:** No switch added or changed; LONGSHOT_NO_CLANG is an existing test variable. **Reviewed:** e2d9c75a20cf against 5740a5dff926: Read the change since the ledger, the surrounding Windows test and screenshot-taking code, and the relevant bridge and compiler-flag sections. Read AGENTS.md, CONTRIBUTING.md and the pull request template; the review checklist was absent. Skimmed the overall diff stat and reported runs; the other changed files were not read in full during this re-check.; nothing run (a code review). **Checked and fine:** - The Windows test takes and removes the plain staged file before attempting to create a symbolic link, so the plain-file check runs when link creation is unavailable. - The reported Windows smoke run exercised the confined game and staged screenshot path. **Testing:** No commands that build, execute project code or run tests were run. The author reports Windows smoke and game-free checks; the confined Linux smoke and quiet Windows build-time comparison remain outstanding. **Overlaps and merge order:** The description says the carried pull requests close in favour of this one; #2726 overlaps the Windows file-service fixes, and #2898 covers the excluded fixes. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
HumanBean merged commit a9670495ab into mod-api 2026-12-01 13:59:43 +00:00
HumanBean deleted branch fix/mod-api-testing-fixes 2026-12-01 13:59:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2938
No description provided.