WIP: fix(fs): a find pattern keeps its wildcard at the path buffer's edge #2180

Draft
dazemc wants to merge 4 commits from dazemc/Longshot:fix/fs-pattern-buffer into main
Contributor

Summary

A folder whose host path is at the end of the path buffer lists itself instead of its contents: OpenDirectory and delete_tree built their find pattern, "dir\*", in a buffer the size of a path (HOS_FS_PATH, 1024). A host path is up to 1023 bytes, so a pattern is two bytes longer than the folder and three with its end: from a 1022-byte folder the wildcard was cut, and FindFirstFileA was given the folder's own name. OpenDirectory then answered a listing whose only entry was the folder itself (or fs::ResultPathNotFound at 1022, where the cut left a trailing separator), GetDirectoryEntryCount counted the folder, and a walk at 1023 built the child's path back onto the folder and never came back.

The pattern now has a buffer with the room for it (HOS_FS_PATTERN, a path + 4), and both places check snprintf's answer the way the file already does for a journal's .tmp: a pattern that does not fit is fs::ResultPathNotFound, as host_path answers for a path that does not fit. delete_tree also stops and reports the tree as still there when a child's path does not fit, since a cut path would name the folder itself, not the child. The directory handle keeps the same pattern for GetDirectoryEntryCount (Handle.pat), while a file handle keeps its own path for the trace (Handle.path): one Handle serves both, so both members exist.

To see it: a save or folder path of 1022–1023 bytes. tests/test_fs_delete_dir.py builds exactly those folders; on main (a2dc5385) its 1023-byte case fails with the folder listed as its own content, and it passes at 77fe1c1b.

Read first: host/nn_fs.c — OpenDirectory, GetDirectoryEntryCount, delete_tree, fs_delete_directory_recursively, and the Handle struct; then tests/test_fs_delete_dir.py.

This branch is stacked on #2154 and cannot be reviewed on its own yet. It carries #2154's commit as its base (now 074a38f5, rebased onto main at a2dc5385), so the diff shows both changes until #2154 merges. It is not a mechanical unstack: this fix returns whether the walk went (delete_tree's 0x202/0x320002 results, gone) and its boundary checks live in tests/test_fs_delete_dir.py, both added by #2154; without that commit there is no result for the walk to return and no test file to extend. When #2154 merges, this is rebased onto main, the duplicate commit drops out, and the suite and the smoke are run again at the new head. The two changes are in one file and are described separately in their commits.

For the deletion path this PR supersedes #2154: it carries #2154's result-code change plus the child-path guard, so if that is simpler a reviewer can merge this and close #2154 — nothing in #2154 is lost, and #2154 on its own does not fix the 1023-byte recursion (its body says so).

Testing

Tested: Linux 7.3.4-zen2-2-zen (x86_64), NVIDIA GeForce RTX 4070 Ti, driver 620.70.06, Vulkan 1.4. The pack over base a2dc5385 at head 77fe1c1b compiles host/nn_fs.c and links (the pack log: 37 s of compiles, link ok). Its runtime boots from the repository save kokiri-start: the Load screen lists the Kokiri Forest save, loads it into Link's house, and Kokiri Forest (child) plays for 15 s — KokiriForest_Child, 3 hearts, 12 life, no fs error in the log — then the game quits with 0; six screenshots and the run's log are in /home/daze/.local/share/longshot-dev/runs/2180-head-smoke (the game's own line: longshot v3.1.1-4-g77fe1c1b (source eb3d815e)). This smoke covers the boot, the save listing/loading and play; the edge itself is covered game-free below, because the save folder's host path here is short.

Game-free: on main at a2dc5385, tests/test_fs_delete_dir.py (with #2154's result-code checks left out so the run reaches the long-path cases) fails at the 1023-byte case's listing (FAIL:533 lists_files(guest): the cut pattern named the folder itself); at 9d49c674, the test commit on #2154's head, it fails at the same case (FAIL:558 lists_files(guest)); at 77fe1c1b it passes, as does tests/test_fs_links.py.

Full suite at 77fe1c1b (tests/run_all.py --strict --jobs 3 in an 8 GB scope): 912 passed / 23 failed / 18 skipped in 833 s. The 23 failing names are the same as on main at a2dc5385 (measured in #2154's Testing: 911 / 23 / 18 in 635 s), one name at a time: nx2/test_import_windows.py, test_close_waits_for_save, test_compile_zero_byte, test_cpm_discovery, test_damaged_rom_files, test_dev_packs, test_draw_stream_visibility, test_fs_save_commit, test_fsr_uniform_ownership, test_guest_copies, test_hold_toggle, test_lower_atomg_cas, test_menu_i18n, test_menu_keys, test_menu_slider_ends, test_mise_build, test_pads_after_menu, test_recording_admission, test_sim_turf_pools, test_sim_turf_settings, test_switch_table, test_tls_objects, test_vibration_menu. The extra pass is the new tests/test_fs_delete_dir.py. The 833 s is longer than that baseline's 635 s because other jobs ran on the PC beside it; the counts, not the time, are the evidence.

Windows: host/nn_fs.c compiles as a Windows COFF object with llvm-mingw 20261104's clang 23.1.5 for x86_64-w64-mingw32, with the flags nx2/build.py gives a host file (--target=x86_64-w64-mingw32 -fms-extensions -D_CRT_SECURE_NO_WARNINGS -march=native -ffp-contract=off -O2 -g0 -mcx16 -DA64_POLLING -DA64_WRITE_TRACK) and headers from host/, third_party/a64-kit/rt and the base's generated gen/. The full Windows game link is not made on this PC.

Still to test:

  • Windows, @Beanstalk: the long-path behaviour on Windows is the half this PC cannot run. On this branch, with HOS_FS_TRACE=1, start the game from a folder tree (or --user folder) deep enough that a folder the game opens has a host path of 1022–1023 bytes, and check the game boots and plays and the log's fs: OpenDirectory(...) lines do not say not found: on main the pattern loses its wildcard there and the folder lists itself. The request is posted after #2154 merges and this branch is rebased onto main, so the farm runs the final head.

Measurements

Nothing to measure: the fix is in host path handling at the end of the path buffer, not a hot path, and it changes nothing per frame.

Risks

A folder or a pattern that does not fit is now refused (fs::ResultPathNotFound) where before it was silently cut; only paths within three bytes of the 1023-byte limit are affected, and a cut pattern was naming the wrong entry anyway. delete_tree now stops at the first child that does not fit rather than walking past it, so a tree with such a child is reported as still there instead of "deleted". Windows is the target: the same FindFirstFileA/DeleteFileA path is what players run, and Linux's posix layer reports the same refusals. A revert is enough; no switch, no file format, no save layout changes, and players notice nothing.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (the title is one topic and a Conventional Commit; the branch is stacked on #2154 (its head 074a38f5, on main at a2dc5385), so today's diff is two changes, and this is why the PR is WIP. It cannot stand alone: the pattern fix returns whether the walk went (delete_tree's result codes) and its checks live in the test file, both of #2154's commit. Ticks when #2154 merges and this is rebased onto main with the stack commit dropped)
  • Tested on my own PC, in the game for a change the game runs, as Testing says: 77fe1c1b, the pack over a2dc5385 boots, the Load screen lists the repository save, Kokiri Forest (child) plays 15 s, the game quits with 0; run folder 2180-head-smoke.
  • mise run test passes (any failure that also fails on main is named): 912 passed / 23 failed / 18 skipped in 833 s at 77fe1c1b; the 23 failing names are the same 23 main shows at a2dc5385, listed in Testing.
  • 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 main and passes here. (tests/test_fs_delete_dir.py at a2dc5385 fails at the 1023-byte listing, and at 9d49c674 on #2154's head; it passes at 77fe1c1b. main's OpenDirectory and delete_tree are the same text as 9d49c674's before this fix.)
  • A check under tests/ that reads changed source is updated, not weakened: tests/test_fs_delete_dir.py gains the 1020/1021/1023-byte cases, and tests/test_fs_links.py gains the pattern's size; no assertion removed.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths: Windows is the host/nn_fs.c COFF object with llvm-mingw 20261104 above; Linux is the pack build over a2dc5385 at 77fe1c1b, which compiles host/nn_fs.c and links, and the game run.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers: all three commits carry Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go) (git log --format='%(trailers)' 074a38f5..77fe1c1b).

Ready to merge

  • Everything in Still to test has run, its results in Tested. Windows has not: the @Beanstalk request waits for the rebase onto main after #2154 merges, so the farm runs the final head.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). One Tier 1 machine has run: Arch Linux, RTX 4070 Ti, NVIDIA 620.70.06 (the in-game smoke above). Tier 1's Windows half has not, which is the same pending Windows item.
  • Approved in review, every comment answered. No review yet.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold. On head 77fe1c1b: the description check passed; the other 10 jobs are Blocked by required conditions and are re-confirmed when they report.
## Summary A folder whose host path is at the end of the path buffer lists itself instead of its contents: `OpenDirectory` and `delete_tree` built their find pattern, `"dir\*"`, in a buffer the size of a path (`HOS_FS_PATH`, 1024). A host path is up to 1023 bytes, so a pattern is two bytes longer than the folder and three with its end: from a 1022-byte folder the wildcard was cut, and `FindFirstFileA` was given the folder's own name. `OpenDirectory` then answered a listing whose only entry was the folder itself (or `fs::ResultPathNotFound` at 1022, where the cut left a trailing separator), `GetDirectoryEntryCount` counted the folder, and a walk at 1023 built the child's path back onto the folder and never came back. The pattern now has a buffer with the room for it (`HOS_FS_PATTERN`, a path + 4), and both places check `snprintf`'s answer the way the file already does for a journal's `.tmp`: a pattern that does not fit is `fs::ResultPathNotFound`, as `host_path` answers for a path that does not fit. `delete_tree` also stops and reports the tree as still there when a child's path does not fit, since a cut path would name the folder itself, not the child. The directory handle keeps the same pattern for `GetDirectoryEntryCount` (`Handle.pat`), while a file handle keeps its own path for the trace (`Handle.path`): one `Handle` serves both, so both members exist. To see it: a save or folder path of 1022–1023 bytes. `tests/test_fs_delete_dir.py` builds exactly those folders; on `main` (`a2dc5385`) its 1023-byte case fails with the folder listed as its own content, and it passes at `77fe1c1b`. Read first: `host/nn_fs.c` — `OpenDirectory`, `GetDirectoryEntryCount`, `delete_tree`, `fs_delete_directory_recursively`, and the `Handle` struct; then `tests/test_fs_delete_dir.py`. This branch is stacked on #2154 and cannot be reviewed on its own yet. It carries #2154's commit as its base (now `074a38f5`, rebased onto `main` at `a2dc5385`), so the diff shows both changes until #2154 merges. It is not a mechanical unstack: this fix returns whether the walk went (`delete_tree`'s `0x202`/`0x320002` results, `gone`) and its boundary checks live in `tests/test_fs_delete_dir.py`, both added by #2154; without that commit there is no result for the walk to return and no test file to extend. When #2154 merges, this is rebased onto `main`, the duplicate commit drops out, and the suite and the smoke are run again at the new head. The two changes are in one file and are described separately in their commits. For the deletion path this PR **supersedes #2154**: it carries #2154's result-code change plus the child-path guard, so if that is simpler a reviewer can merge this and close #2154 — nothing in #2154 is lost, and #2154 on its own does not fix the 1023-byte recursion (its body says so). ## Testing **Tested:** Linux `7.3.4-zen2-2-zen` (x86_64), NVIDIA GeForce RTX 4070 Ti, driver `620.70.06`, Vulkan 1.4. The pack over base `a2dc5385` at head `77fe1c1b` compiles `host/nn_fs.c` and links (the pack log: 37 s of compiles, link ok). Its runtime boots from the repository save `kokiri-start`: the Load screen lists the Kokiri Forest save, loads it into Link's house, and Kokiri Forest (child) plays for 15 s — `KokiriForest_Child`, 3 hearts, 12 life, no fs error in the log — then the game quits with 0; six screenshots and the run's log are in `/home/daze/.local/share/longshot-dev/runs/2180-head-smoke` (the game's own line: `longshot v3.1.1-4-g77fe1c1b (source eb3d815e)`). This smoke covers the boot, the save listing/loading and play; the edge itself is covered game-free below, because the save folder's host path here is short. Game-free: on `main` at `a2dc5385`, `tests/test_fs_delete_dir.py` (with #2154's result-code checks left out so the run reaches the long-path cases) fails at the 1023-byte case's listing (`FAIL:533 lists_files(guest)`: the cut pattern named the folder itself); at `9d49c674`, the test commit on #2154's head, it fails at the same case (`FAIL:558 lists_files(guest)`); at `77fe1c1b` it passes, as does `tests/test_fs_links.py`. Full suite at `77fe1c1b` (`tests/run_all.py --strict --jobs 3` in an 8 GB scope): **912 passed / 23 failed / 18 skipped in 833 s**. The 23 failing names are the same as on `main` at `a2dc5385` (measured in #2154's Testing: 911 / 23 / 18 in 635 s), one name at a time: `nx2/test_import_windows.py`, `test_close_waits_for_save`, `test_compile_zero_byte`, `test_cpm_discovery`, `test_damaged_rom_files`, `test_dev_packs`, `test_draw_stream_visibility`, `test_fs_save_commit`, `test_fsr_uniform_ownership`, `test_guest_copies`, `test_hold_toggle`, `test_lower_atomg_cas`, `test_menu_i18n`, `test_menu_keys`, `test_menu_slider_ends`, `test_mise_build`, `test_pads_after_menu`, `test_recording_admission`, `test_sim_turf_pools`, `test_sim_turf_settings`, `test_switch_table`, `test_tls_objects`, `test_vibration_menu`. The extra pass is the new `tests/test_fs_delete_dir.py`. The 833 s is longer than that baseline's 635 s because other jobs ran on the PC beside it; the counts, not the time, are the evidence. Windows: `host/nn_fs.c` compiles as a Windows COFF object with llvm-mingw 20261104's `clang` 23.1.5 for `x86_64-w64-mingw32`, with the flags `nx2/build.py` gives a host file (`--target=x86_64-w64-mingw32 -fms-extensions -D_CRT_SECURE_NO_WARNINGS -march=native -ffp-contract=off -O2 -g0 -mcx16 -DA64_POLLING -DA64_WRITE_TRACK`) and headers from `host/`, `third_party/a64-kit/rt` and the base's generated `gen/`. The full Windows game link is not made on this PC. **Still to test:** - Windows, @Beanstalk: the long-path behaviour on Windows is the half this PC cannot run. On this branch, with `HOS_FS_TRACE=1`, start the game from a folder tree (or `--user` folder) deep enough that a folder the game opens has a host path of 1022–1023 bytes, and check the game boots and plays and the log's `fs: OpenDirectory(...)` lines do not say `not found`: on `main` the pattern loses its wildcard there and the folder lists itself. The request is posted after #2154 merges and this branch is rebased onto `main`, so the farm runs the final head. ## Measurements Nothing to measure: the fix is in host path handling at the end of the path buffer, not a hot path, and it changes nothing per frame. ## Risks A folder or a pattern that does not fit is now refused (`fs::ResultPathNotFound`) where before it was silently cut; only paths within three bytes of the 1023-byte limit are affected, and a cut pattern was naming the wrong entry anyway. `delete_tree` now stops at the first child that does not fit rather than walking past it, so a tree with such a child is reported as still there instead of "deleted". Windows is the target: the same `FindFirstFileA`/`DeleteFileA` path is what players run, and Linux's posix layer reports the same refusals. A revert is enough; no switch, no file format, no save layout changes, and players notice nothing. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. (the title is one topic and a Conventional Commit; the branch is **stacked on #2154** (its head `074a38f5`, on `main` at `a2dc5385`), so today's diff is two changes, and this is why the PR is WIP. It cannot stand alone: the pattern fix returns whether the walk went (`delete_tree`'s result codes) and its checks live in the test file, both of #2154's commit. Ticks when #2154 merges and this is rebased onto `main` with the stack commit dropped) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says: `77fe1c1b`, the pack over `a2dc5385` boots, the Load screen lists the repository save, Kokiri Forest (child) plays 15 s, the game quits with 0; run folder `2180-head-smoke`. - [x] `mise run test` passes (any failure that also fails on `main` is named): 912 passed / 23 failed / 18 skipped in 833 s at `77fe1c1b`; the 23 failing names are the same 23 `main` shows at `a2dc5385`, listed in Testing. - [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 `main` and passes here. (`tests/test_fs_delete_dir.py` at `a2dc5385` fails at the 1023-byte listing, and at `9d49c674` on #2154's head; it passes at `77fe1c1b`. `main`'s `OpenDirectory` and `delete_tree` are the same text as `9d49c674`'s before this fix.) - [x] A check under `tests/` that reads changed source is updated, not weakened: `tests/test_fs_delete_dir.py` gains the 1020/1021/1023-byte cases, and `tests/test_fs_links.py` gains the pattern's size; no assertion removed. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths: Windows is the `host/nn_fs.c` COFF object with llvm-mingw 20261104 above; Linux is the pack build over `a2dc5385` at `77fe1c1b`, which compiles `host/nn_fs.c` and links, and the game run. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers: all three commits carry `Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)` (`git log --format='%(trailers)' 074a38f5..77fe1c1b`). ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. Windows has not: the `@Beanstalk` request waits for the rebase onto `main` after #2154 merges, so the farm runs the final head. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). One Tier 1 machine has run: Arch Linux, RTX 4070 Ti, NVIDIA 620.70.06 (the in-game smoke above). Tier 1's Windows half has not, which is the same pending Windows item. - [ ] Approved in review, every comment answered. No review yet. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. On head `77fe1c1b`: the description check passed; the other 10 jobs are `Blocked by required conditions` and are re-confirmed when they report.
delete_tree returned nothing, so its DeleteFileA, its recursive call and its
RemoveDirectoryA were all made without looking at the answer, and
DeleteDirectoryRecursively answered 0 whatever happened: a folder whose file
another process holds open (or a read-only one after a restore) was reported
deleted, and so was a path that does not exist, where Horizon answers
fs::ResultPathNotFound (0x202) as DeleteFile three lines up already does.

delete_tree now stops at the first thing that would not go and says whether
the folder went. DeleteDirectoryRecursively answers 0x202 for a path that is
not there, and fs::ResultPermissionDenied (0x320002, the fs code behind a
refused delete) for a folder that outlived the attempt; success is still 0.

Windows is the target: host files are opened without FILE_SHARE_DELETE there,
and a read-only file cannot be deleted. On Linux the posix layer reports the
same refusals (unlink/rmdir EACCES, EROFS, ENOTEMPTY) as ERROR_ACCESS_DENIED,
so the walk and the result are right there too.

tests/test_fs_delete_dir.py compiles delete_tree and the HLE over the posix
file functions, with DeleteFileA refusing one file as Windows does and a
missing path, a held file at the top and a held file deepest first. It fails
on main (the missing path and the held folder both answer 0) and passes here.
tests/test_fs_delete_dir.py now also builds OpenDirectory, ReadDirectory,
GetDirectoryEntryCount and CloseDirectory over the posix layer, and takes the
in-place walk through a folder whose host path is 1023 bytes: a path is 1023
at most, and a find pattern is the folder, a separator and '*'.

At 1023 bytes the pattern needs three bytes more than the folder, but it is
built in a buffer the size of the path. The wildcard is cut and FindFirstFileA
is given the folder's own name, so OpenDirectory answers a listing whose one
entry is the folder itself (and GetDirectoryEntryCount says 1) where its two
files are what it holds. At 1022 bytes the cut leaves a trailing separator and
an existing folder answers fs::ResultPathNotFound.

The check also pins 1020 and 1021 bytes (the last lengths where the folder and
a one-byte child fit) as listing and deleting, and asks at 1023 that the walk
does not answer 0 while both files are still there: a child's path passes what
this layer holds. It fails on 342f665d and passes with the fix that follows.

The walk at 1023 is asked in a child process: a pattern that names the folder
itself builds the child's path back onto it, and such a walk never returns.

test_fs_links.py builds delete_tree too and needs the pattern's size.
OpenDirectory and delete_tree built "dir\*" in a buffer the size of the path
(HOS_FS_PATH), but a pattern is two bytes longer than the folder and three with
its end. host_path allows 1023 bytes, so from 1022 the wildcard was cut:
FindFirstFileA got the folder's own name instead of its contents. OpenDirectory
answered a listing whose only entry was the folder itself, or ResultPathNotFound
for an existing folder at 1022 where the cut left a trailing separator, and
GetDirectoryEntryCount counted the folder; the walk at 1023 built the child's
path back onto the folder and never came back.

The pattern now has a buffer with the room for it (HOS_FS_PATTERN, HOS_FS_PATH
+ 4) and snprintf's answer is checked in both places, answering
fs::ResultPathNotFound as host_path does when the path does not fit: the same
checked-snprintf idiom the file already uses (save_journal's ".tmp"). The
pattern a folder keeps for GetDirectoryEntryCount (Handle.pat, once path) has
the same room, so counting reads the same pattern the listing did.

delete_tree also stops and reports the tree as still there when a child's path
does not fit HOS_FS_PATH: a cut path would name the folder itself, not the
child.

tests/test_fs_delete_dir.py fails at 1023 bytes on 342f665d and passes here;
test_fs_links.py builds delete_tree too and needed the pattern's size.
fix(fs): a file handle keeps its path, a folder handle has its pattern
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
88bbb94184
bbf1fd8f gave a directory handle's find pattern the room of its own
(HOS_FS_PATTERN, a path plus "\\*" and its end) by renaming Handle.path to
Handle.pat. One Handle serves both kinds, and a file handle kept its own path
there for the trace (a read, a write, a resize, a close). The rename took the
member out from under OpenFile and read_at, so host/nn_fs.c no longer
compiled, and the pack build over the base stopped in nn_fs.c with

  host/nn_fs.c:1378:88: error: no member named 'path' in 'Handle'

and said nothing of the game. The checks that build this file cut out
delete_tree and the directory handle, which use pat, so neither of them
noticed.

Handle keeps both: path[HOS_FS_PATH], as before, for a file handle's own path,
and pat[HOS_FS_PATTERN] for a folder's pattern. The pack build over the base
compiles nn_fs.c again, and the smoke runs it.
Author
Contributor

Tested in game: Linux 7.3.4-zen2, AMD GPU (RADV, Mesa): built the pack over base 9e10f6f7 and ran dev.py ab --scene kokiri-forest --runs 1 --seconds 20 (run 20261121-174045-change-kokiri-forest). A main @ 9e10f6f7: 1817 frames, 90.9 fps, median 10.98 ms, p99 13.71 ms, 1% low 72.9 fps, 0 cold frames. B this PR @ 88bbb941: 1767 frames, 88.4 fps, median 11.38 ms, p99 14.85 ms, 1% low 67.3 fps, 0 cold frames. Single 20 s runs each side; the 2.5 fps gap is spread, not a claim. Kokiri Forest, quality preset Custom, 67% (1707x960), output 2560x1440, frame generation and vsync off, uncapped.

Tested in game: Linux 7.3.4-zen2, AMD GPU (RADV, Mesa): built the pack over base 9e10f6f7 and ran dev.py ab --scene kokiri-forest --runs 1 --seconds 20 (run 20261121-174045-change-kokiri-forest). A main @ 9e10f6f7: 1817 frames, 90.9 fps, median 10.98 ms, p99 13.71 ms, 1% low 72.9 fps, 0 cold frames. B this PR @ 88bbb941: 1767 frames, 88.4 fps, median 11.38 ms, p99 14.85 ms, 1% low 67.3 fps, 0 cold frames. Single 20 s runs each side; the 2.5 fps gap is spread, not a claim. Kokiri Forest, quality preset Custom, 67% (1707x960), output 2560x1440, frame generation and vsync off, uncapped.
Author
Contributor

Correction to the 'Tested in game' comment above: it named the wrong GPU. Every run in this session was on this PC's NVIDIA GeForce RTX 4070 Ti, driver 620.70.06, Linux 7.3.4-zen2-2-zen (the game's own line: vk: device 0: NVIDIA GeForce RTX 4070 Ti, Vulkan 1.4 ... NVIDIA's driver) — not an AMD/RADV/Mesa machine. The numbers are unaffected (run 20261121-174045-change-kokiri-forest): A main @ 9e10f6f7 1817 frames, 90.9 fps, median 10.98 ms, p99 13.71 ms, 1% low 72.9 fps, 0 cold frames; B this PR @ 88bbb941 1767 frames, 88.4 fps, 11.38 ms, 14.85 ms, 67.3 fps, 0 cold frames; single 20 s runs each side. The description now states the right hardware.

Correction to the 'Tested in game' comment above: it named the wrong GPU. Every run in this session was on this PC's NVIDIA GeForce RTX 4070 Ti, driver 620.70.06, Linux 7.3.4-zen2-2-zen (the game's own line: `vk: device 0: NVIDIA GeForce RTX 4070 Ti, Vulkan 1.4 ... NVIDIA's driver`) — not an AMD/RADV/Mesa machine. The numbers are unaffected (run 20261121-174045-change-kokiri-forest): A main @ 9e10f6f7 1817 frames, 90.9 fps, median 10.98 ms, p99 13.71 ms, 1% low 72.9 fps, 0 cold frames; B this PR @ 88bbb941 1767 frames, 88.4 fps, 11.38 ms, 14.85 ms, 67.3 fps, 0 cold frames; single 20 s runs each side. The description now states the right hardware.
dazemc changed title from fix(fs): a find pattern keeps its wildcard at the path buffer's edge to WIP: fix(fs): a find pattern keeps its wildcard at the path buffer's edge 2026-11-22 05:45:13 +00:00
dazemc force-pushed fix/fs-pattern-buffer from 88bbb94184
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 77fe1c1be7
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
2026-11-22 08:41:18 +00:00
Compare
Author
Contributor

Rebased onto #2154's rebased head 074a38f5 (on main at a2dc5385): the branch is now 9d49c674 (test), 53278a47 (pattern fix), 77fe1c1b (handle members), and host/nn_fs.c over 074a38f5 is the pattern change alone — #2154's result codes are untouched, as the stack note says. The rebase was clean, as expected (git diff 4905e56c 074a38f5 -- host/nn_fs.c tests/test_fs_delete_dir.py tests/test_fs_links.py is empty).

The AI-trailer box was false and is corrected: all three commits now carry Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go). The suite and the in-game boxes are unticked until their runs land at this head, and the host-build row and the Ready-to-merge section are added to the description.

Game-free at this head: tests/test_fs_delete_dir.py fails at 9d49c674 on the 1023-byte listing (FAIL:558 lists_files(guest)) and passes at 77fe1c1b; the same check fails on main at a2dc5385 (FAIL:533); tests/test_fs_links.py passes. host/nn_fs.c compiles as a coff-x86_64 object with llvm-mingw 20261104 / clang 23.1.5. The full suite and the pack's boot and play run at 77fe1c1b are running now.

Rebased onto #2154's rebased head `074a38f5` (on `main` at `a2dc5385`): the branch is now `9d49c674` (test), `53278a47` (pattern fix), `77fe1c1b` (handle members), and `host/nn_fs.c` over `074a38f5` is the pattern change alone — #2154's result codes are untouched, as the stack note says. The rebase was clean, as expected (`git diff 4905e56c 074a38f5 -- host/nn_fs.c tests/test_fs_delete_dir.py tests/test_fs_links.py` is empty). The AI-trailer box was false and is corrected: all three commits now carry `Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)`. The suite and the in-game boxes are unticked until their runs land at this head, and the host-build row and the Ready-to-merge section are added to the description. Game-free at this head: `tests/test_fs_delete_dir.py` fails at `9d49c674` on the 1023-byte listing (`FAIL:558 lists_files(guest)`) and passes at `77fe1c1b`; the same check fails on `main` at `a2dc5385` (`FAIL:533`); `tests/test_fs_links.py` passes. `host/nn_fs.c` compiles as a `coff-x86_64` object with llvm-mingw 20261104 / clang 23.1.5. The full suite and the pack's boot and play run at `77fe1c1b` are running now.
Author
Contributor

Head 77fe1c1b is tested now; the description has the numbers and the two boxes ticked.

  • Full suite (tests/run_all.py --strict --jobs 3, 8 GB scope) at 77fe1c1b: 912 passed / 23 failed / 18 skipped in 833 s. The 23 failing names are the same 23 main shows at a2dc5385 (911 / 23 / 18 in 635 s, in #2154's Testing), compared one name at a time; the extra pass is the new tests/test_fs_delete_dir.py. The time is longer only because other jobs ran beside it.
  • In-game at 77fe1c1b (the pack over a2dc5385, run folder /home/daze/.local/share/longshot-dev/runs/2180-head-smoke): the Load screen lists the Kokiri Forest repository save, loads it into Link's house, and Kokiri Forest (child) plays 15 s (KokiriForest_Child, 3 hearts, 12 life, no fs error in the log); the game quits with 0. The game's own line is longshot v3.1.1-4-g77fe1c1b (source eb3d815e).
  • Game-free fail/pass at this head: tests/test_fs_delete_dir.py fails at 9d49c674 (the 1023-byte listing, FAIL:558) and on main at a2dc5385 (FAIL:533), and passes at 77fe1c1b with tests/test_fs_links.py.
  • host/nn_fs.c compiles as a coff-x86_64 object with llvm-mingw 20261104 / clang 23.1.5. The host-build row is ticked on that and the Linux pack build.

Still WIP on one box: the branch is stacked on #2154 (074a38f5) and is not one topic against main until that merges. When it does, this is rebased onto main (the stack commit drops out; git diff 4905e56c 074a38f5 over these files is empty), and the suite and the smoke are run again at the new head. The @Beanstalk Windows long-path request is posted after that rebase, so the farm runs the final head.

Head `77fe1c1b` is tested now; the description has the numbers and the two boxes ticked. - Full suite (`tests/run_all.py --strict --jobs 3`, 8 GB scope) at `77fe1c1b`: **912 passed / 23 failed / 18 skipped in 833 s**. The 23 failing names are the same 23 `main` shows at `a2dc5385` (911 / 23 / 18 in 635 s, in #2154's Testing), compared one name at a time; the extra pass is the new `tests/test_fs_delete_dir.py`. The time is longer only because other jobs ran beside it. - In-game at `77fe1c1b` (the pack over `a2dc5385`, run folder `/home/daze/.local/share/longshot-dev/runs/2180-head-smoke`): the Load screen lists the Kokiri Forest repository save, loads it into Link's house, and Kokiri Forest (child) plays 15 s (`KokiriForest_Child`, 3 hearts, 12 life, no fs error in the log); the game quits with 0. The game's own line is `longshot v3.1.1-4-g77fe1c1b (source eb3d815e)`. - Game-free fail/pass at this head: `tests/test_fs_delete_dir.py` fails at `9d49c674` (the 1023-byte listing, `FAIL:558`) and on `main` at `a2dc5385` (`FAIL:533`), and passes at `77fe1c1b` with `tests/test_fs_links.py`. - `host/nn_fs.c` compiles as a `coff-x86_64` object with llvm-mingw 20261104 / clang 23.1.5. The host-build row is ticked on that and the Linux pack build. Still WIP on one box: the branch is stacked on #2154 (`074a38f5`) and is not one topic against `main` until that merges. When it does, this is rebased onto `main` (the stack commit drops out; `git diff 4905e56c 074a38f5` over these files is empty), and the suite and the smoke are run again at the new head. The `@Beanstalk` Windows long-path request is posted after that rebase, so the farm runs the final head.
Member

@dazemc only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@dazemc only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/fs-pattern-buffer:dazemc-fix/fs-pattern-buffer'
git switch 'dazemc-fix/fs-pattern-buffer'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!2180
No description provided.