fix(libkernel): classify Windows directory links by app0 scope #8726

Merged
ArjenS-LA merged 3 commits from upstream-pr/8726 into main 2026-10-26 07:36:06 +00:00
ArjenS-LA commented 2026-10-20 22:33:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-20T22:33:56Z.


What

Windows directory enumeration classifies links by canonical app0 scope: live links inside that root report their target type, while dangling links and links outside it remain DT_LNK. Failed initial stat returns DT_UNKNOWN, and the directory snapshot is published only after collection succeeds. This follows the reviewed resolved-path scope.

The test correction in c5229e510a4b463fd4f6d39f017793d753f7c86b uses Windows backslashes for relative symbolic-link targets and RemoveDirectoryW/DeleteFileW for cleanup of dangling and looping reparse points. Production code is unchanged from 4fb4187bd327a33cb139959d596c46782c3ac08d.

Tested

Windows x64, supported MinGW-w64 GCC 15.2.0: both the previous and corrected fixtures freshly compile and pass the junction cases against the same preserved libraries from 4fb4187. Both leave no test directories behind. Native symbolic-link cases skip because the user token lacks symbolic-link privilege, so the reviewer’s failure is not independently reproduced locally. JJenkx reported five failing runs followed by five passing runs with these exact test edits and symlink cases enabled. His offered rerun on this corrected head remains pending.

The branch and current-main conventions checkers pass, as does whitespace validation. No full build, full CTest, homebrew or GPU run was repeated for this test-only correction. Full Linux/Windows CI still needs a collaborator-triggered run for the new head; the previous successful Build workflow skipped its platform test jobs.

Earlier implementation validation at 4fb4187 remains applicable to the unchanged production code: full build and explicit libraries build passed; CTest reported 1,882 passes, 6 skips and 3 unresolved GPU sample-order failures. Released Prospero Explorer v1.0 (PPSA99109) execution, with disclosed host-added junction and removable-file fixtures, showed app0 junction type 4 and DT_UNKNOWN for the disappearing entry. Original package bytes were unchanged; decrypted inputs were converted separately. This established directory-response behavior under those accommodations, not gameplay or physical-console behavior.

Current overlap check: main c8d34aa8f4d8058d57169cc1e423ba6db00faaf0, corrected head c5229e510a4b463fd4f6d39f017793d753f7c86b, 1,288 open PRs with complete paginated changed-file lists. This PR merges cleanly with main. Tree-only comparisons of 129 shared-file peers yielded 89 clean pairs, 3 conflicts and 37 inconclusive pairs because the peer already conflicts with main. No other open PR changes the Windows link fixture. Source review was selective; combined runtime compatibility is unverified.

Peer Checked head Existing conflict
#8520 0a64d23bdf502e32b1857009a5227634d4a53f16 core/libs/prx/libkernel/File/src/DirectoryDescriptor.cpp
#9732 acac3b1c00a97443536b6697bb2f7ad46a0c57b5 docs/dev/debt/libkernel.md
#10121 e9b842569aaf59e5b1282b2637b10e94d589109b docs/dev/debt/libkernel.md

#8520 integration must preserve archive/disk enumeration, inode/cursor handling, canonical-app0 target typing, failed-stat DT_UNKNOWN and complete snapshot publication. Its ordering discussion remains pending. #9732’s author agreed to #8726 first, then rebase while retaining both debt entries. #10121 ordering remains pending; both adjacent debt entries must survive. The test correction does not alter these existing overlaps. The complementary Linux PR #9303 has merged.

Checklist

  • Based on current main; no other open PR implements the same functions — tested merge against the exact main above; overlapping implementation and integration limits are disclosed.
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; unsupported classifications remain explicit
  • No notes, investigation Markdown files or images added to the repository
  • New third-party code is a submodule built from source — none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a — directory enumeration change
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4943422104 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-20T22:33:56Z. --- ### What Windows directory enumeration classifies links by canonical app0 scope: live links inside that root report their target type, while dangling links and links outside it remain DT_LNK. Failed initial stat returns DT_UNKNOWN, and the directory snapshot is published only after collection succeeds. This follows the [reviewed resolved-path scope](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6331774970). The test correction in `c5229e510a4b463fd4f6d39f017793d753f7c86b` uses Windows backslashes for relative symbolic-link targets and `RemoveDirectoryW`/`DeleteFileW` for cleanup of dangling and looping reparse points. Production code is unchanged from `4fb4187bd327a33cb139959d596c46782c3ac08d`. ### Tested Windows x64, supported MinGW-w64 GCC 15.2.0: both the previous and corrected fixtures freshly compile and pass the junction cases against the same preserved libraries from 4fb4187. Both leave no test directories behind. Native symbolic-link cases skip because the user token lacks symbolic-link privilege, so the reviewer’s failure is not independently reproduced locally. [JJenkx reported five failing runs followed by five passing runs with these exact test edits and symlink cases enabled](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6345771806). His [offered rerun on this corrected head](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6347274728) remains pending. The branch and current-main conventions checkers pass, as does whitespace validation. No full build, full CTest, homebrew or GPU run was repeated for this test-only correction. Full Linux/Windows CI still needs a collaborator-triggered run for the new head; the previous successful Build workflow skipped its platform test jobs. Earlier implementation validation at 4fb4187 remains applicable to the unchanged production code: full build and explicit libraries build passed; CTest reported 1,882 passes, 6 skips and 3 unresolved GPU sample-order failures. Released Prospero Explorer v1.0 (PPSA99109) execution, with disclosed host-added junction and removable-file fixtures, showed app0 junction type 4 and DT_UNKNOWN for the disappearing entry. Original package bytes were unchanged; decrypted inputs were converted separately. This established directory-response behavior under those accommodations, not gameplay or physical-console behavior. Current overlap check: main `c8d34aa8f4d8058d57169cc1e423ba6db00faaf0`, corrected head `c5229e510a4b463fd4f6d39f017793d753f7c86b`, 1,288 open PRs with complete paginated changed-file lists. This PR merges cleanly with main. Tree-only comparisons of 129 shared-file peers yielded 89 clean pairs, 3 conflicts and 37 inconclusive pairs because the peer already conflicts with main. No other open PR changes the Windows link fixture. Source review was selective; combined runtime compatibility is unverified. | Peer | Checked head | Existing conflict | | --- | --- | --- | | #8520 | `0a64d23bdf502e32b1857009a5227634d4a53f16` | `core/libs/prx/libkernel/File/src/DirectoryDescriptor.cpp` | | #9732 | `acac3b1c00a97443536b6697bb2f7ad46a0c57b5` | `docs/dev/debt/libkernel.md` | | #10121 | `e9b842569aaf59e5b1282b2637b10e94d589109b` | `docs/dev/debt/libkernel.md` | #8520 integration must preserve archive/disk enumeration, inode/cursor handling, canonical-app0 target typing, failed-stat DT_UNKNOWN and complete snapshot publication. [Its ordering discussion](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6353757462) remains pending. [#9732’s author agreed to #8726 first](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6349268353), then rebase while retaining both debt entries. [#10121 ordering](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6364043733) remains pending; both adjacent debt entries must survive. The test correction does not alter these existing overlaps. The complementary Linux PR #9303 has merged. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions — tested merge against the exact main above; overlapping implementation and integration limits are disclosed. - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; unsupported classifications remain explicit - [x] No notes, investigation Markdown files or images added to the repository - [x] New third-party code is a submodule built from source — none added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a — directory enumeration change - [x] AI-assisted: yes
MarcZX10 commented 2026-10-20 22:52:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:52:47Z.

Review: APPROVED


Reviewed the current diff and test report. Deriving the getdents entry type from the same no-follow FillLinkStat classification used by lstat correctly distinguishes ordinary files/directories from normal, dangling, and self-loop junctions. Load builds a temporary snapshot and only publishes it after every entry is classified, so an unsupported reparse type does not leave a partially loaded directory. The author reports the Windows junction regression failing on baseline and passing on the PR, plus the full CTest delta with only identical pre-existing failures. Hosted conventions/eligibility/intake/labels pass; platform build jobs are skipped. I did not run a local Windows build. AI-assisted review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5592792621 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#pullrequestreview-5592792621). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T22:52:47Z. **Review:** APPROVED --- Reviewed the current diff and test report. Deriving the `getdents` entry type from the same no-follow `FillLinkStat` classification used by `lstat` correctly distinguishes ordinary files/directories from normal, dangling, and self-loop junctions. `Load` builds a temporary snapshot and only publishes it after every entry is classified, so an unsupported reparse type does not leave a partially loaded directory. The author reports the Windows junction regression failing on baseline and passing on the PR, plus the full CTest delta with only identical pre-existing failures. Hosted conventions/eligibility/intake/labels pass; platform build jobs are skipped. I did not run a local Windows build. AI-assisted review.
oneandonlydean commented 2026-10-20 23:34:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T23:34:02Z.


@ArjenS-LA Thanks. Deriving the type from FillLinkStat is the right source, and publishing the snapshot only after classification is careful.

One request about the new failure path. EntryType throws when FillLinkStat fails. That can happen for an entry that's deleted between the directory listing and the stat (another thread or process cleaning up a temp or save directory), or one the host refuses to stat. main gave such an entry a type and carried on, so the whole getdents call would now end the process instead. FreeBSD has DT_UNKNOWN (0) for an entry whose type isn't known. Could a failed stat give DT_UNKNOWN (or skip an entry that no longer exists) instead of throwing? Keep NotImplemented for a type that really is unsupported.

After that, the bar is a full CI run with guest_directory_link_types and the existing directory-entry tests passing on Linux and Windows.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304195617 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6304195617). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T23:34:02Z. --- @ArjenS-LA Thanks. Deriving the type from `FillLinkStat` is the right source, and publishing the snapshot only after classification is careful. One request about the new failure path. `EntryType` throws when `FillLinkStat` fails. That can happen for an entry that's deleted between the directory listing and the stat (another thread or process cleaning up a temp or save directory), or one the host refuses to stat. `main` gave such an entry a type and carried on, so the whole `getdents` call would now end the process instead. FreeBSD has `DT_UNKNOWN` (0) for an entry whose type isn't known. Could a failed stat give `DT_UNKNOWN` (or skip an entry that no longer exists) instead of throwing? Keep `NotImplemented` for a type that really is unsupported. After that, the bar is a full CI run with `guest_directory_link_types` and the existing directory-entry tests passing on Linux and Windows.
ArjenS-LA commented 2026-10-21 00:11:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-21T00:11:05Z.


I reproduced the stat race in Prospero Explorer 1.0 (PPSA99109) and prepared the narrow fix: failed FillLinkStat returns DT_UNKNOWN (0), while unsupported types and reparse points still take the existing NotImplemented path.

Using the same shipped Explorer package and workload, a debugger breakpoint removes one added host fixture immediately before stat. Published head b898b072bb9429390537d78cfd074a6d95349b1a aborts with directory entry type: No such file or directory; the rebuilt kernel returns that entry with type 0. No guest memory/register writes or injected guest calls were used. Original package bytes stay unchanged; the prior unwrapped copies/relinker and baseline library snapshot are reused, with only the rebuilt kernel substituted for the fixed run. This proves the observed directory-enumeration path under that disclosed race fixture, not general startup/gameplay or console behavior.

Windows x64, MinGW-w64 GCC 15.2.0: the same six directory regression executables pass with both baseline and fixed libraries. Junction cases executed; optional symbolic-link subcases skipped because the host lacks that privilege. The explicit libs build passes. The full build retains the previously recorded unrelated ImageArrayWindowPastLayerLimit.cpp error (65536-byte requested alignment exceeds the 8192-byte object limit). Native CTest: 1548 passed, 1 failed, 18 skipped; 221 script-driven or unavailable tests were excluded. Failed native tests: agc_driver_lookup_log_fits_build. The AGC failure passes on isolated reruns of both baseline and fixed builds; the original parallel-suite failure remains recorded, with its cause unresolved. guest_audio3d_port exceeded 30 seconds locally (49.31 s); no test timeout or unrelated source was changed. GPU used by broad native tests: NVIDIA GeForce RTX 4070 SUPER, Windows driver 32.0.16.1088. This is not a clean complete-suite result or a fresh full baseline comparison.

The patch is still local and uncommitted (base above; tree 54371a619e665444cc3e0a0684feee40a2b57fdc). Four repository commits from today are visible, but the coordinator records do not certify the combined count including disposable test commits across sessions, so the daily commit rule prevents creating another commit. Full Linux/Windows CI also remains outstanding: this account has no upstream workflow-dispatch/write permission, so a collaborator will need to run it after an update is publishable. I have not pushed this fix. The patch and exact commands, hashes and logs are preserved in .codex/pr-maintainer/logs/pass-20261020T2338Z; the worktree is .codex/pr-maintainer/worktrees/pr-8726-20261020.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304693312 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6304693312). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-21T00:11:05Z. --- I reproduced the stat race in Prospero Explorer 1.0 (PPSA99109) and prepared the narrow fix: failed `FillLinkStat` returns `DT_UNKNOWN` (0), while unsupported types and reparse points still take the existing `NotImplemented` path. Using the same shipped Explorer package and workload, a debugger breakpoint removes one added host fixture immediately before stat. Published head `b898b072bb9429390537d78cfd074a6d95349b1a` aborts with `directory entry type: No such file or directory`; the rebuilt kernel returns that entry with type 0. No guest memory/register writes or injected guest calls were used. Original package bytes stay unchanged; the prior unwrapped copies/relinker and baseline library snapshot are reused, with only the rebuilt kernel substituted for the fixed run. This proves the observed directory-enumeration path under that disclosed race fixture, not general startup/gameplay or console behavior. Windows x64, MinGW-w64 GCC 15.2.0: the same six directory regression executables pass with both baseline and fixed libraries. Junction cases executed; optional symbolic-link subcases skipped because the host lacks that privilege. The explicit `libs` build passes. The full build retains the previously recorded unrelated `ImageArrayWindowPastLayerLimit.cpp` error (65536-byte requested alignment exceeds the 8192-byte object limit). Native CTest: 1548 passed, 1 failed, 18 skipped; 221 script-driven or unavailable tests were excluded. Failed native tests: `agc_driver_lookup_log_fits_build`. The AGC failure passes on isolated reruns of both baseline and fixed builds; the original parallel-suite failure remains recorded, with its cause unresolved. `guest_audio3d_port` exceeded 30 seconds locally (49.31 s); no test timeout or unrelated source was changed. GPU used by broad native tests: NVIDIA GeForce RTX 4070 SUPER, Windows driver 32.0.16.1088. This is not a clean complete-suite result or a fresh full baseline comparison. The patch is still local and uncommitted (base above; tree `54371a619e665444cc3e0a0684feee40a2b57fdc`). Four repository commits from today are visible, but the coordinator records do not certify the combined count including disposable test commits across sessions, so the daily commit rule prevents creating another commit. Full Linux/Windows CI also remains outstanding: this account has no upstream workflow-dispatch/write permission, so a collaborator will need to run it after an update is publishable. I have not pushed this fix. The patch and exact commands, hashes and logs are preserved in `.codex/pr-maintainer/logs/pass-20261020T2338Z`; the worktree is `.codex/pr-maintainer/worktrees/pr-8726-20261020`.
oneandonlydean commented 2026-10-21 13:04:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T13:04:16Z.


@ArjenS-LA thanks for this. For links the guest makes itself, DT_LNK is what FreeBSD reports, so that part is right. The problem is /app0. A real app0 never contains links, so any link in it comes from how the host built the app0 directory, and a title enumerating it expects the target's type.

We have a concrete case of this on Linux, where main's getdents already passes the host type through. PPSA04263 crashes at about 0 s when its top-level app0 directories are symlinks into the dump, and it runs when they are real directories. The title lists /app0 and only walks into entries typed DT_DIR. With the links typed 10, it never opens any of them, and it crashes on startup. Symlinked files are fine, because they're opened by name and open follows the link.

Today Windows reports a junction to a directory as 4, so a junction-built app0 works there. After this change it would report 10, so the same title would see the same listing on Windows (we haven't run it there). Your Explorer row shows the switch on /app0 itself (junction-fixture: type=4 → type=10).

Could you keep the target's type inside the app0 tree? For an entry under /app0 whose FillLinkStat mode is a link, resolve it (the following stat) and return 4 or 8 for the target. Keep 10 when the link dangles, and keep 10 everywhere outside app0 (/data, /download0), where the guest can create links. The fixture then needs its junction outside app0 to check 10, plus one junction inside app0 that must come back as 4.

We're making the matching change to the Linux path, so both platforms will treat app0 the same way.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6316760397 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6316760397). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T13:04:16Z. --- @ArjenS-LA thanks for this. For links the guest makes itself, `DT_LNK` is what FreeBSD reports, so that part is right. The problem is `/app0`. A real app0 never contains links, so any link in it comes from how the host built the app0 directory, and a title enumerating it expects the target's type. We have a concrete case of this on Linux, where `main`'s `getdents` already passes the host type through. PPSA04263 crashes at about 0 s when its top-level app0 directories are symlinks into the dump, and it runs when they are real directories. The title lists `/app0` and only walks into entries typed `DT_DIR`. With the links typed 10, it never opens any of them, and it crashes on startup. Symlinked files are fine, because they're opened by name and open follows the link. Today Windows reports a junction to a directory as 4, so a junction-built app0 works there. After this change it would report 10, so the same title would see the same listing on Windows (we haven't run it there). Your Explorer row shows the switch on `/app0` itself (`junction-fixture: type=4` → `type=10`). Could you keep the target's type inside the app0 tree? For an entry under `/app0` whose `FillLinkStat` mode is a link, resolve it (the following stat) and return 4 or 8 for the target. Keep 10 when the link dangles, and keep 10 everywhere outside app0 (`/data`, `/download0`), where the guest can create links. The fixture then needs its junction outside app0 to check 10, plus one junction inside app0 that must come back as 4. We're making the matching change to the Linux path, so both platforms will treat app0 the same way.
ArjenS-LA commented 2026-10-21 17:41:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-21T17:41:19Z.


@oneandonlydean I reproduced the Windows part with a focused native junction fixture on Windows x64 / MinGW-w64 GCC 15.2.0. Against the published b898b072bb9429390537d78cfd074a6d95349b1a kernel snapshot, enumeration through /data passes with type 10, while enumeration through /app0 fails with junction: getdents type 10, expected 4. The existing local DT_UNKNOWN stat-race patch gives the same results, so it does not address this additional regression. These are synthetic native tests, not PPSA04263 or fresh Explorer execution; optional symbolic-link cases skipped for lack of Windows privilege, while junction cases executed.

There is a path-tracking detail to coordinate: Load obtains the resolved host path with GetFinalPathNameByHandleW, and OpenInDirectory_nid_no_patch likewise opens relative to that resolved path. A host-path prefix check alone can lose the /app0 origin after entering a junction whose target is outside the mapped root. Can you link the matching Linux change so I can align the Windows directory-origin tracking with it? The /app0 request remains unresolved and no updated kernel commit has been pushed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6322546666 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6322546666). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-21T17:41:19Z. --- @oneandonlydean I reproduced the Windows part with a focused native junction fixture on Windows x64 / MinGW-w64 GCC 15.2.0. Against the published `b898b072bb9429390537d78cfd074a6d95349b1a` kernel snapshot, enumeration through `/data` passes with type 10, while enumeration through `/app0` fails with `junction: getdents type 10, expected 4`. The existing local `DT_UNKNOWN` stat-race patch gives the same results, so it does not address this additional regression. These are synthetic native tests, not PPSA04263 or fresh Explorer execution; optional symbolic-link cases skipped for lack of Windows privilege, while junction cases executed. There is a path-tracking detail to coordinate: `Load` obtains the resolved host path with `GetFinalPathNameByHandleW`, and `OpenInDirectory_nid_no_patch` likewise opens relative to that resolved path. A host-path prefix check alone can lose the `/app0` origin after entering a junction whose target is outside the mapped root. Can you link the matching Linux change so I can align the Windows directory-origin tracking with it? The `/app0` request remains unresolved and no updated kernel commit has been pushed.
ArjenS-LA commented 2026-10-21 23:40:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-21T23:40:33Z.


@oneandonlydean I found the matching Linux change in #9303 at 58ad4eda77577412aab42a180a82fc164d1cfab1. Its resolved-descriptor-path check explicitly leaves nested links typed DT_LNK after entering an app0 link whose target is outside the canonical app0 root.

Should the Windows correction mirror that documented limitation, or must it preserve the guest /app0 origin across those directory opens? This determines whether a resolved-path check is sufficient or directory-origin tracking must change.

Both PRs also add different implementations of core/libs/tests/GuestDirectoryLinkTypes.cpp. I propose keeping the Windows fixture in a separate Windows-specific source file when integrating the correction. The published head remains b898b072bb9429390537d78cfd074a6d95349b1a; this update is source/merge inspection only, with no new runtime result or pushed fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6329023715 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6329023715). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-21T23:40:33Z. --- @oneandonlydean I found the matching Linux change in #9303 at `58ad4eda77577412aab42a180a82fc164d1cfab1`. Its resolved-descriptor-path check explicitly leaves nested links typed `DT_LNK` after entering an app0 link whose target is outside the canonical app0 root. Should the Windows correction mirror that documented limitation, or must it preserve the guest `/app0` origin across those directory opens? This determines whether a resolved-path check is sufficient or directory-origin tracking must change. Both PRs also add different implementations of `core/libs/tests/GuestDirectoryLinkTypes.cpp`. I propose keeping the Windows fixture in a separate Windows-specific source file when integrating the correction. The published head remains `b898b072bb9429390537d78cfd074a6d95349b1a`; this update is source/merge inspection only, with no new runtime result or pushed fix.
oneandonlydean commented 2026-10-22 03:13:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T03:13:46Z.


@ArjenS-LA Mirror the #9303 limitation; don't add directory-origin tracking in this PR.

#9303 decides "inside /app0" from the resolved descriptor path (weakly_canonical of /app0 plus the directory's resolved path), as your GetFinalPathNameByHandleW check would. With it, links that sit directly in /app0 or in a directory below it, links to links, relative links and an /app0 that is itself a link all report as directories. Entries inside a directory that an app0 link led outside the root stay DT_LNK. That nested case is documented in the debt doc and no title we have run needs it, while tracking the guest origin across every directory open adds state to each descriptor for a case nobody has hit. If a title does need it, that is a separate change for both platforms.

So on Windows the /app0 junction enumeration should report type 4, like the Linux fixture, and a junction that leads outside the root and holds further links should stay type 10, with the limitation worded the same in docs/dev/debt/libkernel.md. I haven't run the Windows side myself, so your fixture is the evidence there.

Keep the Windows fixture in its own source file. #9303's GuestDirectoryLinkTypes.cpp is the Linux test (skipped elsewhere), so two different files under one name would only collide.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331774970 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6331774970). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-22T03:13:46Z. --- @ArjenS-LA Mirror the #9303 limitation; don't add directory-origin tracking in this PR. #9303 decides "inside `/app0`" from the resolved descriptor path (`weakly_canonical` of `/app0` plus the directory's resolved path), as your `GetFinalPathNameByHandleW` check would. With it, links that sit directly in `/app0` or in a directory below it, links to links, relative links and an `/app0` that is itself a link all report as directories. Entries inside a directory that an app0 link led outside the root stay `DT_LNK`. That nested case is documented in the debt doc and no title we have run needs it, while tracking the guest origin across every directory open adds state to each descriptor for a case nobody has hit. If a title does need it, that is a separate change for both platforms. So on Windows the `/app0` junction enumeration should report type 4, like the Linux fixture, and a junction that leads outside the root and holds further links should stay type 10, with the limitation worded the same in `docs/dev/debt/libkernel.md`. I haven't run the Windows side myself, so your fixture is the evidence there. Keep the Windows fixture in its own source file. #9303's `GuestDirectoryLinkTypes.cpp` is the Linux test (skipped elsewhere), so two different files under one name would only collide.
ArjenS-LA commented 2026-10-22 05:50:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-22T05:50:34Z.


@oneandonlydean The local correction now mirrors #9303's resolved-path limitation. It follows live links when the enumerated directory resolves inside canonical /app0, retains DT_LNK for dangling links and nested links reached outside that root, and keeps the earlier DT_UNKNOWN stat-failure correction. The Windows fixture is now GuestWindowsDirectoryLinkTypes.cpp, with its own test name.

Windows x64 / MinGW-w64 GCC 15.2.0 results:

  • The identical expanded native fixture fails against published head b898b072bb9429390537d78cfd074a6d95349b1a (app0 junction type 10 instead of 4) and passes against the draft. It covers outside-app0 links, chained junctions, dangling/loop junctions, nested external targets, a sibling-path boundary, and app0 itself being a junction. Optional symbolic-link subcases skip because this host lacks the privilege.
  • All six existing directory regression executables pass with both library versions.
  • Fresh execution of the same Prospero Explorer 1.0 / PPSA99109 package changes its added app0 junction response from type 10 to 4. The controlled disappearance fixture aborts on the published kernel and returns type 0 on the draft. Original package hashes remain unchanged. This observes directory responses, not gameplay or console behavior.

This is still an uncommitted draft, tree 9899b6e7b8014a74a472725b97978bcfc26f4267, based on the published head; nothing has been pushed. Validation rebuilt the changed kernel object and relinked it with preserved same-base build objects, including the required Windows unwind processing. It is not a clean full build/CTest result. Full validation and collaborator-run Linux/Windows CI remain outstanding, and combined daily commit accounting is still uncertified.

The draft merges textually with main 4a17c71757644170c6a0acfcc67fb17f81cff93f and #9303 58ad4eda77577412aab42a180a82fc164d1cfab1; those integrations have not been runtime tested. The wider audit retains a documentation conflict with #9239 and 22 inconclusive kernel comparisons because peers conflict with main. Patch, commands, binary/input hashes and logs: .codex/pr-maintainer/logs/pass-20261022T0534Z. AI-assisted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333782263 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6333782263). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-22T05:50:34Z. --- @oneandonlydean The local correction now mirrors #9303's resolved-path limitation. It follows live links when the enumerated directory resolves inside canonical `/app0`, retains `DT_LNK` for dangling links and nested links reached outside that root, and keeps the earlier `DT_UNKNOWN` stat-failure correction. The Windows fixture is now `GuestWindowsDirectoryLinkTypes.cpp`, with its own test name. Windows x64 / MinGW-w64 GCC 15.2.0 results: - The identical expanded native fixture fails against published head `b898b072bb9429390537d78cfd074a6d95349b1a` (app0 junction type 10 instead of 4) and passes against the draft. It covers outside-app0 links, chained junctions, dangling/loop junctions, nested external targets, a sibling-path boundary, and app0 itself being a junction. Optional symbolic-link subcases skip because this host lacks the privilege. - All six existing directory regression executables pass with both library versions. - Fresh execution of the same Prospero Explorer 1.0 / PPSA99109 package changes its added app0 junction response from type 10 to 4. The controlled disappearance fixture aborts on the published kernel and returns type 0 on the draft. Original package hashes remain unchanged. This observes directory responses, not gameplay or console behavior. This is still an uncommitted draft, tree `9899b6e7b8014a74a472725b97978bcfc26f4267`, based on the published head; nothing has been pushed. Validation rebuilt the changed kernel object and relinked it with preserved same-base build objects, including the required Windows unwind processing. It is not a clean full build/CTest result. Full validation and collaborator-run Linux/Windows CI remain outstanding, and combined daily commit accounting is still uncertified. The draft merges textually with main `4a17c71757644170c6a0acfcc67fb17f81cff93f` and #9303 `58ad4eda77577412aab42a180a82fc164d1cfab1`; those integrations have not been runtime tested. The wider audit retains a documentation conflict with #9239 and 22 inconclusive kernel comparisons because peers conflict with main. Patch, commands, binary/input hashes and logs: `.codex/pr-maintainer/logs/pass-20261022T0534Z`. AI-assisted.
ArjenS-LA commented 2026-10-22 11:44:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-22T11:44:49Z.


@simonbronk I checked the #9732 overlap with Git's merge engine against main 8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768, normalizing both PRs onto that same base. #8726 at 4fb4187bd327a33cb139959d596c46782c3ac08d and #9732 at eb900c3d7a08388d9df34b9b1b4bd3799f8eade4 each merge with main, but their combined tree conflicts in docs/dev/debt/libkernel.md.

This is an adjacent documentation edit: the Windows directory-type entry is inserted immediately before your revised vector-I/O entry. Both entries should survive; the implementation files are separate.

I propose #8726 first, then rebasing #9732 while preserving both entries. Does that order work for you? Maintainers retain the final choice; no dependency has been declared before agreement. This check used source inspection and tree-only merges, with no new commits, builds or runtime tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6339925264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6339925264). Originally posted by [ArjenS-LA](https://github.com/ArjenS-LA) on 2026-10-22T11:44:49Z. --- @simonbronk I checked the #9732 overlap with Git's merge engine against main `8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768`, normalizing both PRs onto that same base. #8726 at `4fb4187bd327a33cb139959d596c46782c3ac08d` and #9732 at `eb900c3d7a08388d9df34b9b1b4bd3799f8eade4` each merge with main, but their combined tree conflicts in `docs/dev/debt/libkernel.md`. This is an adjacent documentation edit: the Windows directory-type entry is inserted immediately before your revised vector-I/O entry. Both entries should survive; the implementation files are separate. I propose #8726 first, then rebasing #9732 while preserving both entries. Does that order work for you? Maintainers retain the final choice; no dependency has been declared before agreement. This check used source inspection and tree-only merges, with no new commits, builds or runtime tests.
MarcZX10 commented 2026-10-22 11:56:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:56:02Z.


Open #9732 changes the vector-I/O debt entry in docs/dev/debt/libkernel.md; pairwise merge of the current heads conflicts in that file, though the implementation topics are independent. Please coordinate merge order with #9732 and preserve both documentation entries when rebasing. No duplicate implementation was found in the code paths.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6340130567 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8726#issuecomment-6340130567). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T11:56:02Z. --- Open #9732 changes the vector-I/O debt entry in `docs/dev/debt/libkernel.md`; pairwise merge of the current heads conflicts in that file, though the implementation topics are independent. Please coordinate merge order with #9732 and preserve both documentation entries when rebasing. No duplicate implementation was found in the code paths.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8726
No description provided.