Skip to content

feat(libkernel): map app0.zar archive-backed files - #11625

Merged
oneandonlydean merged 17 commits into
boykopovar:mainfrom
Felipebmaitan:feat/archive-file-mapping
Nov 21, 2026
Merged

oneandonlydean merged 17 commits into
boykopovar:mainfrom
Felipebmaitan:feat/archive-file-mapping

Conversation

@Felipebmaitan

@Felipebmaitan Felipebmaitan commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

Map files from app0.zar through the native regular-file path. Each mapping owns a read-only backing object for the requested guest-page-rounded window, clipped at EOF, with a native offset of zero. Loose files take precedence. The mapping survives close or reuse of the guest descriptor, with the existing protection, partial-unmap and host EOF behavior.

Archive reads check each destination page before advancing the cursor. HostWrite opens watched pages, while the checked copies handle invalid addresses and preserve partial progress. Materialization holds the shared descriptor attachment lock while it copies, serializing reads, seeks and maps on duplicate descriptors.

The branch preserves published head 00a2d202a33c9b09e38321962cefacd1506db1b8 and integrates main through e481b135558fc4316bc3b24e7408156737eff08d. It carries main's Windows fixed-private-map bookkeeping, macOS empty-iovec guards and newer archive-descriptor test expectations. The debt edits use a fragment that preserves main's neighboring entries.

One independent review inspected the full archive diff at 1b8fea2423fe5b4b5e29900a14153f17ed502dc3. The follow-up translates Windows backing-write exhaustion to ENOSPC or EFBIG for the corresponding native error, and checks macOS shared write upgrades against matched loose-file mappings. Windows and Linux still require EACCES for the upgrades, and the tests restore read-only protection before checking guest destination faults.

The Windows reader now opens with read access and no delete-on-close flag. The writer owns file cleanup. Private mappings finish copying before the reader closes, and shared views keep the native section alive after the descriptor closes. Lifetime review

#12682 remains the declared predecessor. A read-only merge preview with its published head 44fde3b660ac816dace9ac0320f2002d23d5787d still conflicts in pread_nid_postfix. The archive branch by itself previews cleanly against main e86afa1936367953144e791327ed2161fdb330ea. After #12682 lands, carry the archive error conversion into its cancellation and pinned-descriptor path and test the combined archive and I/O behavior. #18190's libkernel_sys wrapper refactor separately conflicts in PosixMemory.cpp at its published head dc73ea0d21d3c6fbf9002ab3fee296f312583147. I compared the 37 unique PRs in the refreshed overlap report against main c8d5f91168d7d8c208478de6d555b6a34c1c9acf and against that main composed with this head 4a2b14298c386cf90332d35bbc2e5c8314d2993f. Newly listed #11831 changes stream lifetime and fcloseall; its published head 1c17f817b396eec0d46ddfedccb5a2ab9113493a merges cleanly in both previews. #18112 contributes a libkernel_web export mirror and already conflicts with main. #7447 introduces a separate archive-stdio source at the same libc CMake registration point. #7121's read notifications add conflicts within its already-conflicting Open.cpp and Stdio.cpp when combined with the archive read-error changes. #6936 changes archive seeking and already conflicts with main. The other previews showed the same conflict files and the same conflict blocks in archive-touched files as their main comparisons. These overlaps involve separate functionality. The declared prerequisite is still #12682.

Tested

  • Windows 11 build 26300, WinLibs GCC 15.2, current head 4a2b14298c386cf90332d35bbc2e5c8314d2993f. The native read-only and executable mapping tests created a section from the materialized reader, closed both the section handle and the reader, then verified the mapped bytes. Both passed, and the isolated backing directory had no temporary backing files after unmap. The descriptor-read and truncated-entry cleanup smoke test also passed. The original reader flags passed the native view lifetime reproducer on this host as well.
  • Windows 11 build 26300, WinLibs GCC 15.2, integration head 86b4b73041f30a97b5a2521b4fae801b4b141e5b. The direct backing test passed requested offsets and bytes, read-only access, independent windows, EOF clipping and truncated input. A second test linked the production archive and backing sources with ZArchive and used a real compressed fixture. It passed loose-file precedence, cursor sharing and positioned partial reads with injected copy rejection, and native mapped views that remained readable after closing their handles.
  • Injected WriteFile results ERROR_HANDLE_DISK_FULL and ERROR_FILE_TOO_LARGE returned ENOSPC and EFBIG and closed the backing handle. The production archive fixture passed MinGW syntax checks at that integration head. The four changed libkernel translation units passed syntax checks and are byte-identical to those checked.
  • Conventions against current origin/main, debt fragment validation and committed-diff whitespace checks passed. The initial function-name overlap scan completed against 2,239 open PRs.
  • 26/26 registered Windows guest CTests passed at 4a2b14298c386cf90332d35bbc2e5c8314d2993f in 7.08 seconds on Windows 11 build 26300, WinLibs GCC 15.2, Release. The selection covered all nine app archive modes across libc and libkernel, including archive mmap, backing failure and damaged input. It also covered filesystem, descriptor duplication, file-vector and positioned I/O, AIO, guest memory, and fixed-anonymous and executable mappings. The archive mmap case verified shared and private mapping data after descriptor close or replacement, checked error handling for unwritable guest destinations, and exercised Windows write-watch collection. CMake used the pinned FFmpeg package after its SHA-256 matched the published release. Fresh Linux and macOS execution remains pending.
  • Hosted checks finished for 4a2b14298c386cf90332d35bbc2e5c8314d2993f with 20 successes and two skips (the full Linux and pipe-write jobs). The Windows job passed. Hosted build run
  • MarcZX10 approved the current head after targeted source review of the backing, mapping, and checked-read paths. The Windows runtime results above are the author's runs. Current-head approval
  • Earlier contributor evidence remains pinned to the revisions tested. ycbuzi reported full CTest runs for previous head 00a2d202a33c9b09e38321962cefacd1506db1b8 composed with main. Windows Server 2022 had 2 failures out of 6,495, both reproduced on main. Windows Server 2025 had 0 out of 6,495. Contributor runs
  • XairRrR's Debian tests and negative controls, the macOS support-composition results, and earlier author runs are recorded below at their original revisions.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: feat(libkernel): cancel blocked POSIX reads with owned operations #12682
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
Earlier descriptions and evidence at their historical revisions

What

November 7 maintenance head 00a2d202a33c9b09e38321962cefacd1506db1b8, integrated with main 4138defef7c468835190768e5143e411bce92d6a. This preserves the complete published 6e2918bffa9d95f46f986f8417b08dbe468fe176 history, including maintainer merges and the macOS mmap error-publication fix. The only integration conflict was the libkernel debt file; both the archive mapping text and main's module-unload debt are retained. No archive runtime implementation was replaced with the stale October checkout, and no graphics source or timeout was changed by this maintenance.

Archive-backed mmap uses read-only native backing for the requested guest-page-rounded window, clipped at EOF and mapped from backing offset zero. Mapping lifetime is independent of the guest descriptor and transient backing descriptor. Loose files retain precedence; private writable mappings, shared read-only permissions, protection changes, partial unmaps and descriptor reuse continue through the established regular-file paths. This is host ZArchive packaging, not console PFS.

Checked archive reads remain deliberate: audited scalar, positioned, vector and AIO callers open HostWrite/OpenIovecs, but those guards do not make arbitrary destination pointers fault-safe. Page-bounded checked copies retain invalid-buffer and partial-progress/cursor behavior. Materialization holds the shared attachment mutex for the requested window; contention and copy cost remain the previously documented tradeoffs. No new performance claim is made.

Tested

Fresh execution on the maintenance head:

  • Windows 11 build 26300, WinLibs GCC 15.2, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON: full production libs and relinker, plus the selected runtime executables, rebuilt with at most two jobs. 27/27 focused tests pass after restoration of the negative controls. These include archive/plain/mmap/backing-failure/damaged modes, ordinary mmap and memory, duplication, scalar/positioned/vector reads, AIO, filesystem and actual Windows write-watch/HostWrite behavior. Synthetic archive entries and loose files with identical bytes are compared by the production API fixtures. Every focused case finishes below 30 seconds; the archive cases retain their registered 20-second limits.
  • Two temporary Windows production-path negative controls: restoring archived mmap refusal makes all three mmap modes fail with the expected refusal while archive/plain reads still pass; replacing only checked archive descriptor reads with the unchecked main implementation makes the invalid-destination mmap case fault while archive/plain still pass. Both changes were removed, production libraries rebuilt, and the complete 27-case selection passed again. No control instrumentation is committed.
  • Ubuntu 24.04 WSL2, kernel 6.6.87.2-microsoft-standard-WSL2, GCC 13.3, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=OFF: full production libs and relinker plus the focused executables built, then rebuilt/restored after the clean-main control. The original registered selection is 23/24: every archive mode, read/positioned/vector/AIO, duplication, ordinary memory and fixed-anonymous mmap passes; ordinary guest_mmap_executable aborts at GuestMemory.cpp:3583 from its registered DrvFS working directory. A clean checkout of parent main 4138defef7c468835190768e5143e411bce92d6a, with the fixture unchanged and its actual production dependency graph rebuilt, reproduces that same assertion; both main and the archive head pass that executable mode from unique native ext4 working directories. The main artifact lacks the archive mapping helper; restoration reinstates it. The underlying working-directory-dependent cause is not explained here and no unrelated memory code or timeout was changed.
  • Final restored Linux selection: 24/24 with only guest_mmap_executable's working directory moved to a unique verified ext4 directory in an untracked temporary CTest registry. Machine-checked JSON comparison verifies all 24 commands and every other test property, including registered timeouts, match the original registry. All other working directories remain unchanged. guest_filesystem separately passes from a unique ext4 directory. The original 23/24 result and its failure are retained, rather than relabeled as an unmodified CTest pass. Linux reports asynchronous userfaultfd write protection unavailable (EINVAL); HostWrite/data checks execute, but actual Linux write-watch collection is not claimed. Actual collection is asserted by the passing Windows cases. Restored binary hashes and runner definitions/properties are retained in the local validation artifacts.
  • Public-header audit: 407 libraries / 30,931 exports. Conventions and committed-diff whitespace checks pass. The overlap scanner completed against 1,765 open PRs, probing 1,764 at main 87473937d31ca4f64d819805b8f0c2b80ac55b53, and exits 2: 76 comparisons with PRs conflicting with main remain inconclusive. The confirmed fix(libc): sort with FreeBSD 11.4's heapsort.c in heapsort #16861 overlap was manually inspected: adjacent libkernel debt edits, with no archive implementation overlap. Live feat(libc): support archive-backed stdio reads #7447 at dead12ebad24a3c4b01a05c14ab60cc06aacaf7d remains a stdio feature without mmap capability; feat(libkernel): support SEEK_DATA and SEEK_HOLE in lseek #6936 at f06949da78cf801f47702e27f0dd987f4b80e184 adds archive seek modes. Their shared integration paths remain open coordination concerns; neither branch was edited or contacted. No clean scan or new ordering agreement is claimed. A read-only merge-tree check against subsequently fetched main 9e47f0c3accfdd390ef5c578c8a6332048200d5d is clean (tree 99ac8c8c3e503ee4c3a54d7d72c5ee01c797f40e); the executed source remains the explicitly pinned maintenance head based on 4138def.

Fresh targeted investigation of the November Radeon timeout report:

  • Inspected the raw isolated logs and broad tests-only overlay failure. The isolated profile_draw runs time out near their registered 60-second cap. The broad overlay stops compiling GuestKernelAppArchive.cpp because main lacks AppArchiveMappingDescriptor_nid_no_patch; it never supplies a clean-main graphics runtime control. The report remains unattributed.
  • Built only agc_driver_graphics_tests on clean reported main e772fb25cc72ee5faf77847f06bbc69533016e82 and its exact composition with PR 6e2918bffa9d95f46f986f8417b08dbe468fe176. The latter is diagnostic commit 15a84102eed7321ad8e5bd94e9f8face06231264, merged tree 9be29b4ca2233ca17556fade4c26117a5bc9cbbf. Graphics/recompiler source trees are identical across this pair. This diagnostic commit is not the maintenance PR head or a published feature change.
  • Both controls pass ctest -R '^agc_graphics_profile_draw$' -V --parallel 1 with the original registered TIMEOUT 60 unchanged, same Windows 11 PC, Ryzen 9800X3D, NVIDIA RTX 5080 / NVIDIA 621.14 / Vulkan 1.4.357, GCC 15.2 Release and ANYPS5_ENABLE_SPIRV_TOOLS=ON. Both use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The complete job held Local\AnyPS5GpuValidation; no concurrent GPU validation was run by the I/O owner. Local Khronos nightly validation layer API 1.4.368 was verified available with vulkaninfo.
  • Neither raw CTest log contains the missing-layer message or any VUID- ID; there are no new validation IDs. Main raw log SHA256: ab50509f6f4637815bf8e484722942e05ec2b320774fffaf621f747cca2e8183; exact-composition raw log SHA256: 8300f2ca860929c93b3a88983602688dcd250402319680c7dfd7a980470f459d.
  • This does not reproduce or clear the reported RX 6300 / RADV / Ubuntu environment, and is not GPU execution evidence for the newer graphics source inherited by the final maintenance head. Main independently changed the test registration to 300 seconds in ae97b16d4a2; that was not used for this diagnostic pair or proposed as an archive fix. A targeted same-RADV-machine clean-main/composition followup, requesting last-subcase output and native thread stacks before the original cap, is prepared locally but has not been posted to the contributor.

Ordering and limits: #12682 remains the declared predecessor, now published at 32121ca48d0abf5e1c11e7c601636d10ec8cb77d; no unpublished candidate was consumed, no I/O owner's branch was edited, and no combined execution is claimed here. #11732 and #12296 are already merged. A later read-only merge check is also clean against fetched main e9032c8e060b417631ec6a2e3116eb1c649d922f (tree 6656a448012741dfc3145624c95dee20f62127a5); this does not relabel that newer main as the executed base. Linux backing requires memfd_create and /proc/self/fd; Windows retains the ordinary private-file snapshot and whole-page EOF behavior. No new macOS, Radeon, game or console execution, full CTest-suite result, or speed result is claimed. Existing approvals apply to their historical reviewed SHAs, not this integration head. Exact-head upstream CI and current-head maintainer review remain external gates.

Historical evidence and previous PR description; historical revisions only

What

November 5 review follow-up, current head 6e2918bffa9d95f46f986f8417b08dbe468fe176: correct the libc app0.zar debt statement to cover archive-only entries outside archive-aware handling, including ordinary path/module resolution and chdir. Source verification: General.cpp ResolvePath_nid_no_patch and ResolvePathOrRelinkedModule_nid_no_patch call AppArchiveRefuseOnly_nid_no_patch, and chdir does likewise; that helper calls NotImplemented_nid_no_patch for archive-only entries. This is a one-sentence documentation change on top of remote maintainer head afe480cff0ab5128712df07cb49b815f2f94e07b; runtime sources and tests are identical to that head.

XairRrR's APPROVED review treats the checked-copy cost and descriptor-mutex hold time as nonblocking suggestions. Per-page checked copies and their partial-progress/cursor/HostWrite semantics remain. A larger-buffer fallback would need to handle already-written bytes when a bulk checked copy fails, retain page-exact partial counts, and be measured before any speed claim. Materialization currently holds the shared attachment mutex throughout decompression/backing writes, so duplicate-descriptor reads, seeks and maps serialize for that window. Snapshotting the node under a shorter lock is a possible follow-up requiring lifetime/concurrency checks. This update records those tradeoffs without changing the implementation or claiming maintainer acceptance of the existing read cost.

November 1 fix at f5d5756c799d2257de279a0963d93068e9f43fff, published in head 91f8d4b237b99a1d996824de43090f452dbce40e: publish the selected mmap errno after exception/resource cleanup. The macOS report is reproduced; the catch selected EIO (5), then exception cleanup changed the host/guest errno slot to ENOENT (2) before return. Mapping now computes its result/error internally and the public wrapper publishes the error after that work has ended. The error classification stays intact: host backing-directory failures and damaged archive data produce EIO, while supported access/resource failures retain their own codes. A missing host temporary path does not mean the already-open guest archive file is missing. Added SCE wrapper checks require the same error and an untouched output pointer on failure.

Bounded requested-window storage, permission/EOF/lifetime semantics and checked reads are retained. The supplied read-cost explanation/benchmark awaits acceptance; this update makes no speed claim. #11732/#12296 ordering is satisfied by their merges; #12682 remains open and is the declared predecessor. Its November 1 inspection pinned head 0e88eeebc91c233aaba95c056c970a1d8b273b36. No I/O cancellation-stack branch (#12682/#12688/#12700/#12965) was changed.

Implement archive-backed file mappings through the regular-file mapping paths. Loose app0 entries still override app0.zar. This is AnyPS5 host ZArchive packaging, not console PFS.

The backing now contains only the requested guest-page-rounded window, clipped at EOF, stored at native offset zero. Linux uses a sealed memfd reopened read-only; Windows/macOS use read-only temporary disk backing. Each live mapping owns independent native storage. No hidden descriptor remains after mmap returns, preserving close/reuse and dup2 behavior. Failed backing writes retain resource errors and clean up without installing a mapping.

Private writable copies, shared read-only permissions, protections, partial unmaps, offsets and EOF retain the established native mapping contract. Linux requires memfd_create and /proc/self/fd. Windows retains regular-file private snapshots and whole-page EOF rejection; macOS execution evidence uses the separately pinned support composition above.

Read copies remain deliberately checked. I audited all actual ReadArchivedFile/ReadArchivedIovecs callers: sceKernelRead, POSIX pread, both host implementations of sceKernelPread, Windows TransferIovecs, POSIX sceKernelReadv/Preadv, and AIO NativePread. Each holds HostWrite/OpenIovecs over its destination. Those guards open watched pages; they do not validate arbitrary pointers. On Linux GuestArenaBeginHostWrite returns true and the write-watch hook is a no-op; on Windows BeginHostWrite checks tracked views, not all arbitrary private/foreign memory. ZArchive copies with CPU stores, so restoring direct destination reads would reintroduce host faults for protected/unmapped pointers. Page-bounded GuestCopyOut preserves EFAULT-before-progress and partial count/cursor semantics. The nested guards also cover direct internal-helper callers. New scalar/positioned/vector/AIO regressions exercise invalid pointers, partial vectors and watched destinations. The measured cost is recorded below, without a title speed claim.

Ordering: #12682 first (replacement for #11872), then this PR, as previously declared. Its current published head is 55161f97476a8bd413c279829cabb6390307e4d5; no candidate is consumed here, and its branches remain untouched. #12296 merged during validation; its Windows shared-memory checks are retained in this rebase, alongside the archive source descriptor and native window offset. #11732 is also merged; its newer VirtualQuery debt text is preserved. Both older order requests are therefore already resolved by main, and neither is an open prerequisite. Direct replies to the outstanding review and ordering comments are recorded in the conversation below.

Tested

November 5 documentation-only verification at 6e2918bffa9d95f46f986f8417b08dbe468fe176: inspected the resolver/chdir refusal paths and the read/materialization locking/copy paths. Conventions (python3 tools/check_conventions.py --base origin/main) and committed-diff whitespace checks passed in an isolated clone against fetched upstream main e772fb25cc72ee5faf77847f06bbc69533016e82. Runtime tests were not rerun for the sentence change. The overlap scan completed against 1,811 open PRs at that main; it reports #15556 on libkernel debt and exits 2 because conflicting-main comparisons remain inconclusive. No new overlap agreement or clean-scan result is claimed.

Independent evidence, pinned to the revisions actually tested:

  • XairRrR's APPROVED review tested PR 783098aabe1d930b25a10c85280ed02a4c219f1f with main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree e34c6e0da86340e7048a4bdd82ea4c60d3f5f5d1, Debian 13/GCC 14.2 Release. All 22 focused tests passed. Reverting the mapping path made all three mmap modes fail; reverting checked reads made the invalid-destination mmap test segfault. Restoring the implementation and rebuilding restored all five archive passes. The noexec-storage variant was unavailable; only missing-directory independence ran. This review establishes neither Windows results nor a rerun of the benchmark, and its acceptance is not attributed to the latest head.
  • imellag's independent macOS confirmation tested the PR's own diff at 91f8d4b237 on support branch 05bd71a66b, macOS 27.2/M4 Pro/Apple clang 21/x86-64 Rosetta Release: 19/19 archive and file cases pass, including both repaired errno cases, plus three more 9/9 archive runs. fix(libkernel): build the file, module and rtld calls on macOS hosts #10552 empty-iovec guards were retained. This is support-composition evidence, not a new full-tree macOS or Windows run.

Windows status on maintainer head afe480cff0ab5128712df07cb49b815f2f94e07b: Build run 41823369138, Windows job 126565422963, is CANCELLED, not failed; Linux is SKIPPED. The Windows relinker job passed, which is separate from runtime validation. The cancelled job could not be rerun through the job-specific retry. A focused workflow-dispatch attempt (build.yml, main, pr=11625, linux=false, select=true) was denied: HTTP 403: Must have admin rights to Repository. API repository permissions show pull=true, push/maintain/admin=false; this local host has no Windows runtime. Fresh focused Windows runtime evidence therefore remains unavailable through this account/environment. No cancelled/skipped job is counted as a pass or failure. Earlier Windows results below remain historical.

#12682 remains OPEN and the declared merge-order predecessor (inspected head 32169af1dc395b182370cdf973687d313d33bfc4). #11732/#12296 ordering is satisfied. No other branch was edited or merged. Existing read-cost acceptance and fresh Windows execution remain external requirements; the review's performance suggestions are nonblocking.

Earlier evidence follows with its original platform/head limits.

November 1 exact published head: 91f8d4b237b99a1d996824de43090f452dbce40e. Preserves the remote maintainer merge 4cb2bc9b2cceab3ef2ff7b8d736f7e04bc89ab9e; integrates upstream main 66e1f7f993c9c1339c2de11264b76bab03218cd2 without rewriting history. Runtime validation built source at fix commit f5d5756c799d2257de279a0963d93068e9f43fff; the final main merge changes none of libc/libkernel/libSceLibcInternal, their test sources or SceTypes.hpp, confirmed by tree comparison.

  • Linux Ubuntu 24.04.5/GCC 13.3, Release, LinuxKit 7.0.12 linux/amd64 container on Apple silicon: rebuilt focused executables and production dependencies. 21/22 focused cases passed, including all archive modes, scalar/vector/positioned read, AIO, duplication and error tests. The remaining guest_memory failure is the zero-length mincore user-boundary errno assertion, now GuestMemory.cpp:4225. A fresh build of main 66e1f7f993c9c1339c2de11264b76bab03218cd2 reproduces the identical assertion. userfaultfd returns EPERM here, so actual Linux write-watch collection is unavailable.
  • macOS 27.0.1 (26A434), Apple M5 Pro, Apple clang 21.0.0, x86-64 Release under Rosetta: matched support composition 05bd71a66bed21dea323da545849781b883fe7f0 + this PR's original a294df9 own diff against de824c2 + the two-file f5d5756 fix. Both reported modes fail before the fix at the original line 924; ordinary mappings pass. After the fix, 15/15 native tests pass: all guest_app_archive and guest_kernel_app_archive modes, guest_file_vector/guest_file_vector_memory, guest_dup, guest_positioned_race, guest_memory and guest_aio. Both fix(libkernel): build the file, module and rtld calls on macOS hosts #10552 Apple empty-iovec blocks are preserved after archive read error conversion in this support composition. This is support-branch composition evidence, not an assertion that standalone main or the full published tree builds/runs on macOS.
  • Patched macOS coverage: copied the rebuilt libc/libkernel/libSceLibcInternal, applied production nid_patcher and ad-hoc signing, and ran a temporary public-API driver with patched guest imports (--exec --only-sce). All three modes passed: normal mapping (nonzero offset contents, scalar/vector positioned reads, lifetime after descriptor close), missing temporary directory, and damaged archive. Each failure mode repeats both POSIX and SCE boundary checks eight times, checking EIO and unchanged SCE output/cursor. Fixture compression is linked into the driver so its native codec symbols stay local. The complete host-linked regression executable has native helper/weak-import resolution requirements; patched coverage is this focused driver, while the complete archive suite above runs unpatched.
  • Conventions (python3 tools/check_conventions.py --base origin/main), whitespace and public-header audit pass (399 libraries / 26,750 exports). Overlap scan of f5d5756 against main 66e1f7f completed across 1,848 open PRs, with confirmed adjacency at fix(libkernel): build the file, module and rtld calls on macOS hosts #10552 (Stdio) and fix(libc): sort with FreeBSD 11.4's merge.c in mergesort #12271 (debt text). Other conflicting-main comparisons, including feat(libkernel): support deferred cancellation in POSIX accept #12965, remain inconclusive and the scanner exits nonzero; no clean-overlap claim or new author agreement is made. fix(libkernel): build the file, module and rtld calls on macOS hosts #10552 composition was inspected and tested as above. Other threads' branches remain untouched.

The macOS support composition is reproducible from patch hashes: original PR diff SHA256 83a1be116e75086554aaaadfe53494e2374d5b29b60eeabcc10dfcc1f00a87ba; two-file fix diff SHA256 677d4d05aed6d41fcb18d79ebab60a0981ec3e1f1b7ea7fc94ed68172d3bdf4e. Temporary instrumentation, driver and logs are outside the repository. No fresh Windows, complete full-suite, GPU, title/console, performance or combined cancellation-stack run is claimed. Earlier evidence below remains pinned to its original heads.

October 31 refresh: exact head a294df92fa9d61d291251a114691a1e689f4d6b0, preserving published head ebf93ca4f62a55df2ef1001b811d1a013a8ef495 and merging upstream main de824c2919ca65086c6324a1e0388866a7327eea. The bounded backing fix was already published in 1440791c77a7e1bbee1684f0726a903ed999dd94; this refresh retains it, the checked reads, and maintainer changes. No history was rewritten and no other I/O head was pushed.

Fresh validation: Ubuntu 24.04.5 / GCC 13.3 / Release / LinuxKit 7.0.12, linux/amd64 container on Apple silicon. Built the selected test targets and their production libc, libSceLibcInternal, libkernel and libkernel_sys dependencies. Focused CTest selection below: 21/22 passed. Every archive, scalar/vector/positioned-read, AIO and descriptor test passed. guest_memory aborted at GuestMemory.cpp:4084 (mincore(0x800000000000, 0, nullptr) errno expectation); after overlaying upstream main and explicitly rebuilding its changed production sources, the identical assertion failed on main too. This is a reproduced baseline/container limitation, not a passing memory suite. userfaultfd returned EPERM, so write-watch collection was unavailable; no actual Linux write-watch coverage is claimed. The archive mmap test also passed a verbose run, including executable mappings with noexec temporary storage.

ctest --test-dir /tmp/anyps5-build -R "^(guest_kernel_app_archive_.*|guest_app_archive_.*|guest_memory|guest_dup|guest_file_vector.*|guest_positioned_race|guest_aio.*|guest_kernel_sys_aio)$" --output-on-failure

Conventions (--base origin/main), whitespace and public-header audit passed (393 libraries / 24,536 exports). Fresh overlap scan ran in an isolated clone at this exact head against 1,558 open PRs: confirmed adjacency with #12271 and #12597 (debt text) and #12868 (Stdio readv/preadv return lines). Manually inspected #12868 at 619546539e534ea4c05e66460f4b79b30d92895a: retain its private-descriptor admission while keeping this PR's archive result-to-SCE conversion. These are integration seams, not duplicate implementations. No new author agreement is claimed; conflicting-main comparisons remain inconclusive and the scan exits nonzero, as designed. The earlier #11732/#12296 order requests are resolved by their merges; #12682 remains the declared predecessor.

Native macOS configuration was attempted but stopped on pre-existing empty LibAtrac9 checkout contents; the original dirty submodules were preserved. No fresh Windows, macOS runtime, full-suite, GPU, title/console, performance, or combined unmerged-stack execution is claimed. The Windows/WSL runs and synthetic benchmark below are historical, pinned to their stated heads; the archive read/backing sources and archive regression file are unchanged between ebf93ca and this refresh.

Historical evidence follows.

Maintenance source head: ebf93ca4f62a55df2ef1001b811d1a013a8ef495, rebased on fetched main 08a10d225306ad102b57408e2ef7566bcfb829b2. The bounded-window implementation is commit 1440791c77a (before the latest main refresh: 9c840020b8e3b0252cf18c9206f39ee6a42cc37c). Earlier approvals and external bare-metal results at e97bbf0 are historical, not validation of this head.

On that exact integrated head:

  • Windows 11, WinLibs GCC 15.2, Release, BUILD_TESTING=ON: full production build (libs and relinker) plus focused test executables passed. CTest selection: 24/24 passed, zero skips, longest 2.50 s.
  • Ubuntu 24.04 under WSL2, kernel 6.6.87.2-microsoft-standard-WSL2, GCC 13.3, Release: full production build (libs and relinker) plus focused test executables passed. Same applicable selection: 22/22 passed, zero skips, longest 0.94 s. The two Windows-only cases are excluded.
  • Selection: guest_kernel_app_archive_* (archive/plain/mmap/mmap-failure/mmap-damaged), guest_app_archive_*, guest_memory, guest_dup, guest_file_vector*, guest_positioned_race, guest_aio*, guest_kernel_sys_aio, and Windows windows_write_watch. This covers requested-window backing size/content, offset rebasing, COW/shared permissions, protections, partial unmaps, concurrent maps, descriptor duplication/close/reuse, native-handle cleanup, bad pointers and partial vector progress, HostWrite and AIO destinations. Linux additionally constrains RLIMIT_FSIZE: a one-page window of a larger entry succeeds; a two-page request fails with EFBIG, without leaks/cursor changes, and retries after restoring the limit.
  • Actual Windows write collection passed. WSL asynchronous userfaultfd write watch is unavailable (EINVAL), so Linux uses the comparison fallback; no Linux write-watch support is claimed. Executable mappings with noexec temporary storage are exercised by the Linux archive mmap test.
  • tools/check_conventions.py --base origin/main, git diff --check, and public-header audit passed (373 libraries, 14,243 exports). Required overlap scan completed. The complete GPU/non-GPU CTest suite was not run; unrelated test executables are not part of the full production build command.

Same-machine synthetic archive read measurements, Windows 11, Ryzen 7 9800X3D, WinLibs GCC 15.2, Release. Benchmark source pins: main 1189ec3003672bb364dd9f3119ead7b3976e3c83 versus final integrated implementation ebf93ca4f62a55df2ef1001b811d1a013a8ef495. Main is the baseline fetched at the start of this maintenance pass; it is not relabeled as the later main revision. identical benchmark executable, archive and APIs (sceKernelOpen/Read/Lseek/Close). Three alternating main/change runs, one warm-up per workload per process, seven recorded samples each (21 samples per cell). Large workload: 256 MiB in 256 reads of 1 MiB. Small workload: 65,536 sequential reads of 64 bytes (4 MiB). First/last bytes and checksums are verified per call; archive creation is outside timing. Host compiler jobs were active, so ranges include contention and these are synthetic cost measurements, not controlled game/scene performance evidence. No trace_digest/game speed claim is made.

Workload main median / range (ms) change median / range (ms)
256 MiB, 1 MiB reads 30.205 / 25.129–40.496 122.651 / 110.839–148.501
65,536 × 64-byte reads 10.802 / 9.907–11.638 74.214 / 66.172–84.626

The checked copy has a substantial measured cost. It is retained to preserve the fault/partial-progress contract; HostWrite alone is insufficient. The implementation bounds mapping storage independently of this read-path tradeoff.

No macOS runtime, PS5/console, title, GPU or combined unmerged-dependency runtime result is claimed unless separately pinned below.

Checklist

Reproducible synthetic read benchmark
#include "prx/libkernel/include/Api.hpp"
#include "prx/libkernel/File/include/FileFlags.hpp"
#include "prx/libkernel/File/include/File.hpp"
#include "AppArchiveFixture.hpp"
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <filesystem>
#include <vector>

int main(int argc, char** argv) {
    if (argc != 3) return 2;
    const auto root = std::filesystem::absolute(argv[1]);
    constexpr std::size_t size = 256 * 1024 * 1024;
    if (std::strcmp(argv[2], "setup") == 0) {
        std::filesystem::create_directories(root / "app0" / "sce_sys");
        AppArchiveFixture::WriteArchive(root / "app0.zar", {{"bench.bin", AppArchiveFixture::Pattern(size)}});
        return 0;
    }
    std::filesystem::current_path(root);
    const int fd = sceKernelOpen("/app0/bench.bin", SCE_KERNEL_O_RDONLY, 0);
    if (fd < 0) return 3;
    for (const std::size_t chunk : {std::size_t{1024 * 1024}, std::size_t{64}}) {
        const std::size_t count = chunk == 64 ? 65536 : size / chunk;
        std::vector<char> buffer(chunk);
        for (int sample = -1; sample < 7; ++sample) {
            if (sceKernelLseek(fd, 0, 0) != 0) return 4;
            std::uint64_t checksum = 0;
            const auto begin = std::chrono::steady_clock::now();
            for (std::size_t call = 0; call < count; ++call) {
                if (sceKernelRead(fd, buffer.data(), chunk) != static_cast<std::int64_t>(chunk)) return 5;
                const auto offset = call * chunk;
                if (buffer.front() != static_cast<char>((offset * 7 + offset / 4096) & 0xff) ||
                    buffer.back() != static_cast<char>(((offset + chunk - 1) * 7 + (offset + chunk - 1) / 4096) & 0xff)) return 6;
                checksum += static_cast<unsigned char>(buffer.front()) + static_cast<unsigned char>(buffer.back());
            }
            const auto seconds = std::chrono::duration<double>(std::chrono::steady_clock::now() - begin).count();
            if (sample >= 0) std::printf("{\"sample\":%d,\"chunk\":%zu,\"bytes\":%zu,\"calls\":%zu,\"seconds\":%.9f,\"checksum\":%llu}\n", sample, chunk, chunk * count, count, seconds, static_cast<unsigned long long>(checksum));
        }
    }
    return sceKernelClose(fd) == 0 ? 0 : 7;
}
main 1048576 21 median_ms 30.2049 min 25.1288 max 40.495999999999995
main 64 21 median_ms 10.801699999999999 min 9.9066 max 11.6379
change 1048576 21 median_ms 122.6511 min 110.8392 max 148.5008
change 64 21 median_ms 74.2136 min 66.1716 max 84.6263
archive-read-bench.cpp 409adbe25a2953bca74f574e81d7f1389449c79da1cf4d970769f9968902e8a6
archive-read-bench.exe 2d65d0ed373c3bcc54ccf167e001f4624687cb5a950e89e70fbb0aea2c4aab53
bench-root/app0.zar 06277dbaeed6c5b4b726114361b7a0cd8c55f8661910a8eac072bcd56d06bb47
bench-main/libc.prx 8bf7bd86fc5a488e0eebe2495638f9629038159477ba270de07d224da0726fe7
bench-main/libkernel.prx 23945a6bc4c968f6166d2236da3ab08aec4aded58cf21cb8d6cb452db6d5e9fe
bench-change/libc.prx bbe7f79999dacb46061c39f52e02f2c3d34da0a60d4ba9792dbd9226d5ddb40b
bench-change/libkernel.prx 498587106aff954a7ba581e7d1cff83b939156dae794918cfa81a2c89c45a47b

Historical overlap scan on ebf93ca (isolated scan clone, branch alias archive-maint-review, same exact SHA): completed against 1,453 open PRs on main 08a10d225306. Confirmed overlaps are this PR itself (same new file), #12682 (Stdio.cpp, declared predecessor), and docs adjacency with #8965 and #12271. The doc-adjacency order is not agreed; no agreement is invented and no contributor message was sent. Other shared-file comparisons that conflict with main remain inconclusive. The earlier #12296 and #11732 requests are already resolved by their merges.

For the later #12682 integration, retain its POSIX Io, descriptor-admission and HostWrite/OpenIovecs scopes, applying the archive native-error conversion separately at the POSIX and SCE return boundaries. The published predecessor head inspected on October 31 is 55161f97476a8bd413c279829cabb6390307e4d5. #12688 transport and #12700 writes remain open downstream of it; they are not additional direct prerequisites of this archive PR. No combined execution with an unpublished refresh is claimed.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head e97bbf045122e4326b0f5332a9844df37bd1d5dc. Archive mappings materialize a request-local read-only backing object, preserve loose-file precedence and descriptor cursor/lifetime semantics, and retain the regular-file mapping path for validation, protections and unmaps. The archive read changes scatter through checked guest writes and translate EFAULT at the public wrappers. The tests cover offset/alignment/EOF behavior, private/shared protections, descriptor replacement/close, partial unmaps, damage and backing failures. Hosted conventions, eligibility, intake, labels, report, register-context, relinker, ASan and write-watch checks pass; product build jobs are skipped by path policy. The author reports Windows and WSL full builds and focused tests, with the DrvFS-only inotify failure explicitly excluded; I did not independently rerun the local suite. I found no blocking issue.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 18112 mmap
PR 18190 core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp L142-149, L250-252 mmap

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4563 core/libs/prx/libkernel/CMakeLists.txt
PR 6149 core/libs/prx/libkernel/CMakeLists.txt
PR 6936 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/File/src/ArchivedFile.cpp
core/libs/prx/libkernel/File/src/Open.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
core/libs/tests/GuestKernelAppArchive.cpp
PR 7121 core/libs/prx/libkernel/File/src/Open.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
PR 7447 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/include/AppArchive.hpp
core/libs/prx/libc/src/AppArchive.cpp
core/libs/prx/libkernel/File/src/ArchivedFile.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
PR 7715 core/libs/prx/libc/CMakeLists.txt
PR 8150 core/libs/prx/libc/CMakeLists.txt
PR 8965 core/libs/prx/libc/CMakeLists.txt
PR 9156 core/libs/prx/libkernel/CMakeLists.txt
PR 9293 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/File/src/Stdio.cpp
PR 9297 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/File/src/Stdio.cpp
PR 9302 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/File/src/Stdio.cpp
PR 9383 core/libs/prx/libkernel/CMakeLists.txt
PR 9389 core/libs/prx/libkernel/CMakeLists.txt
PR 9466 core/libs/prx/libc/CMakeLists.txt
PR 9557 core/libs/prx/libkernel/CMakeLists.txt
PR 9566 core/libs/prx/libkernel/CMakeLists.txt
PR 9938 core/libs/prx/libkernel/CMakeLists.txt
PR 11831 core/libs/prx/libc/CMakeLists.txt
PR 11896 core/libs/prx/libkernel/CMakeLists.txt
PR 12717 core/libs/prx/libc/CMakeLists.txt
PR 12849 core/libs/prx/libc/CMakeLists.txt
PR 15037 core/libs/prx/libkernel/File/src/Stdio.cpp
PR 16790 core/libs/prx/libkernel/CMakeLists.txt
PR 16791 core/libs/prx/libc/CMakeLists.txt
PR 17433 core/libs/prx/libkernel/CMakeLists.txt
PR 18112 core/libs/prx/libkernel/CMakeLists.txt
PR 19181 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libkernel/CMakeLists.txt
PR 20975 core/libs/prx/libkernel/CMakeLists.txt
PR 21022 core/libs/prx/libkernel/CMakeLists.txt
PR 21041 core/libs/prx/libkernel/CMakeLists.txt
PR 21051 core/libs/prx/libkernel/CMakeLists.txt
PR 21672 core/libs/prx/libkernel/CMakeLists.txt
PR 22815 core/libs/prx/libkernel/CMakeLists.txt
PR 23204 core/libs/prx/libkernel/CMakeLists.txt
PR 24343 core/libs/prx/libkernel/CMakeLists.txt

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First bare-metal Linux run, since the Linux results in the PR are from WSL2 and the memfd + /proc/self/fd backing is Linux-only.

Exact head e97bbf045122e4326b0f5332a9844df37bd1d5dc, merged on main cb45ae2dd. Linux x86_64 (bare metal, ext4), i7-8700, Ubuntu 26.04, kernel 7.0, GCC 15.2, glibc 2.43, CMake 4.2.3, Ninja, Release, BUILD_TESTING=ON, full build.

  • The 5 guest_kernel_app_archive_* tests (archive, plain, mmap, mmap-failure, mmap-damaged) pass, 3 of 3 runs.
  • guest_filesystem passes here, so the inotify assertion that failed on DrvFS is fine on a native filesystem.
  • A wider subset of 76 file, stdio, mmap and app-archive tests (guest_kernel*, guest_stdio*, guest_file*, guest_mmap*, guest_app*, ...) passes. Full non-GPU suite on the same main without the PR: 1361/1361.
  • With the implementation reverted to main (AppArchive*, the libc CMakeLists.txt, PosixMemory.cpp, ArchivedFile.cpp, Open.cpp, Stdio.cpp; new tests and their CMake modes kept), mmap, mmap-failure and mmap-damaged abort with mmap on a file read from app0.zar, fd=7 not implemented; archive and plain still pass.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@milescoviello

Copy link
Copy Markdown
Contributor

@Felipebmaitan my docs-only #11732 appends to the sceKernelVirtualQuery entry in docs/dev/debt/libkernel.md, the line just above the app0.zar files and directories entry this PR rewrites, so git merge-tree reports a one-line conflict. I'm happy for this PR to land first: I've marked #11732 Depends on: #11625 and will rebase it once this one merges. If you'd prefer the other order, say so and I'll switch.

AI-assisted: yes (Claude Code)

@Felipebmaitan

Felipebmaitan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

For coordination with #11872, I am selecting #11872 first, then #11625 for these two PRs under my account. The later archive-mapping rebase must retain the POSIX Io/descriptor admission and HostWrite scopes while applying this PR's archive result-to-POSIX/SCE error mapping, keeping the two return conventions separate. Archive mmap work remains in this PR. Combined checks should retain archive read/positioned/vector/mapping and descriptor close/reuse cases. This records the merge-order decision; I have updated only this PR's Depends on line to #11872 for merge ordering. Its branch head and source files are unchanged; no combined runtime test is claimed. AI-assisted coordination.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Felipebmaitan the mapping side reads right to us: the sealed memfd reopened read-only on Linux, the helper descriptor closed before mmap returns, no descriptor that a guest dup2 can replace, and resource errors kept as their own codes. Two questions before it lands:

  1. Each mmap copies the whole decompressed entry. The backing holds the full entry whatever length and offset the guest asked for, and repeated mappings copy again, with no cap or sharing. A loader that maps small windows of a large asset pays the full entry size every time (on Linux that is memory). Please either back only the requested window (mapped at offset 0 of the backing), or share one backing per entry while any mapping of it lives, or state the limit you accept and what happens when an entry is larger than the available storage.
  2. The read path now goes through a 4 KiB bounce buffer. AppArchiveDescriptorRead does one AppArchiveRead plus one GuestCopyOut (and so one GuestArena::HostWrite open/close) per page-aligned chunk, for every app0.zar read, not just mapping. Every caller already opens a HostWrite (or OpenIovecs) over the whole destination before it gets there: sceKernelRead, pread, both sceKernelPreads, sceKernelReadv/Preadv, TransferIovecs and the AIO read. What does the nested per-page check catch that the outer one does not? If it is needed, please give same-machine numbers for main and this PR on an archived file: one large sequential read (say 256 MiB in reads of 1 MiB or more) and many small reads. If the outer guard already covers it, keeping the direct read into the destination would avoid the question.

@JJenkx

JJenkx commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@Felipebmaitan a merge-order question from #12296 (Windows: map shared-memory descriptors with the regular-file checks). The repository's overlap check pairs the two PRs on core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp, where this PR renames the line above #12296's change to const int mappingDescriptor = sourceDescriptor; while #12296 removes the shared-memory gate right below it. Merged, the line takes your name and keeps #12296's block; nothing else overlaps.

CONTRIBUTING asks overlapping authors to agree on an order and record it under Depends on. #12296 is small and its reviewer otherwise found no defect, so I'd propose #12296 lands first and the rebase here is the small textual merge described above. If you'd rather this PR go first, say so and I'll set Depends on: #11625 on #12296 and do the rebase myself after yours lands. Either works for me.

AI-assisted: yes (Claude Code).

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head afe480c merged onto main 5b1d381 · tested 2026-11-04 13:37 UTC · 25 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 3,770 passed · 18 failed (0 new, 12 also fail on main, 6 unstable on main) · 62 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 3,850 of 3,883 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1444 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.5 s, ⚠️ agc_driver_graphics_maps_fallback 120.2 s, ⚠️ agc_driver_graphics 120.2 s, ⚠️ agc_driver_bda_device 57.5 s, ⚠️ agc_driver_lazy_resolved_abi_switch_set 53.8 s
Unstable on main (6, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export: failed in 4 of the last 10 main runs
agc_driver_array_layer_target_cpu: failed in 3 of the last 10 main runs
agc_driver_graphics: failed in 3 of the last 10 main runs
agc_driver_graphics_maps_fallback: failed in 2 of the last 10 main runs
agc_driver_pipeline_journal: failed in 8 of the last 10 main runs
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: failed in 3 of the last 10 main runs
Failing on main too (12, not counted against this PR)
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_job_manager_compute_capacity
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_submit_progress
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (64, not in the main baseline's validation pass)
public_headers
public_headers_compile_0
public_headers_compile_1
public_headers_compile_10
public_headers_compile_11
public_headers_compile_12
public_headers_compile_13
public_headers_compile_14
public_headers_compile_15
public_headers_compile_16
public_headers_compile_17
public_headers_compile_18
public_headers_compile_2
public_headers_compile_20
public_headers_compile_21
public_headers_compile_22
public_headers_compile_23
public_headers_compile_24
public_headers_compile_25
public_headers_compile_26
public_headers_compile_27
public_headers_compile_28
public_headers_compile_29
public_headers_compile_3
public_headers_compile_30
public_headers_compile_31
public_headers_compile_32
public_headers_compile_33
public_headers_compile_34
public_headers_compile_35
public_headers_compile_36
public_headers_compile_37
public_headers_compile_38
public_headers_compile_39
public_headers_compile_4
public_headers_compile_40
public_headers_compile_41
public_headers_compile_42
public_headers_compile_43
public_headers_compile_44
public_headers_compile_45
public_headers_compile_46
public_headers_compile_47
public_headers_compile_48
public_headers_compile_49
public_headers_compile_5
public_headers_compile_50
public_headers_compile_51
public_headers_compile_52
public_headers_compile_53
public_headers_compile_54
public_headers_compile_55
public_headers_compile_56
public_headers_compile_57
public_headers_compile_58
public_headers_compile_59
public_headers_compile_6
public_headers_compile_60
public_headers_compile_61
public_headers_compile_62
public_headers_compile_63
public_headers_compile_7
public_headers_compile_8
public_headers_compile_9
Validation IDs already present on main (8 IDs in 797 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (797 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_alpha_to_coverage_sample_mask_export, and 789 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
Skipped (62)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_storage_pending_key_refresh: skipped, refreshes over a pending key store are not testable here
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergp
Reproduce
git fetch origin afe480cff0ab5128712df07cb49b815f2f94e07b 5b1d381d5ad5d9f923326b18479c3bd889cdd588
git checkout 5b1d381d5ad5d9f923326b18479c3bd889cdd588 && git merge --no-ff afe480cff0ab5128712df07cb49b815f2f94e07b
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@XairRrR corrected the documentation mismatch in 6e2918bffa9d95f46f986f8417b08dbe468fe176, pushed normally on top of maintainer head afe480cff0ab5128712df07cb49b815f2f94e07b. The libc debt entry now states the general restriction: archive-only entries remain unsupported by calls without archive-aware handling; ordinary path/module resolution and chdir still throw. I verified both resolvers and chdir call AppArchiveRefuseOnly_nid_no_patch, which calls NotImplemented_nid_no_patch for an archive-only entry. This commit changes one sentence; runtime sources/tests are identical to afe480c.

I’ve recorded the other two notes as nonblocking follow-ups, consistent with your approval. Checked per-page copies retain EFAULT/partial-progress/cursor/HostWrite behavior; your control B independently demonstrates the safety need. A bulk-copy fallback must account for bytes already written by a failed bulk check and retain page-exact progress before any speed benefit can be claimed. The descriptor attachment mutex currently covers the entire materialization and serializes reads/seeks/maps on duplicates sharing that attachment. A shorter node-snapshot lock is a plausible follow-up with lifetime/concurrency validation. No optimization or speed claim is added here, and maintainer acceptance of the existing read-cost evidence remains separate.

The full PR template now pins your 22/22 Linux run and both negative controls to 783098aabe1d930b25a10c85280ed02a4c219f1f + main 086c0686c8adff3ee648fdbe34e0b0b647e1d511 (merged tree e34c6e0da86340e7048a4bdd82ea4c60d3f5f5d1), including the unavailable noexec-storage variant. It also records imellag’s independent confirmation at 91f8d4b237 on the pinned macOS support composition: 19/19 file/archive cases and three further 9/9 archive runs. These remain evidence at those revisions, not newly run tests on this documentation commit.

For Windows, run 41823369138 / job 126565422963 at afe480c is CANCELLED, not failed; Linux is SKIPPED. The cancelled job-specific retry was unavailable. I then attempted the focused dispatch (build.yml, main, pr=11625, linux=false, select=true); GitHub rejected it with HTTP 403: Must have admin rights to Repository. Repository permissions are pull=true and push/maintain/admin=false, and this local environment has no Windows runtime. I cannot supply a fresh runtime result through that access; the passing Windows relinker check is recorded separately. Earlier Windows evidence stays pinned to its older heads.

Source audit, committed-diff whitespace and python3 tools/check_conventions.py --base origin/main pass against fetched main e772fb25cc72ee5faf77847f06bbc69533016e82. The overlap scan completed and retains inconclusive conflicting-main comparisons; no clean-scan or new coordination agreement is claimed. #12682 remains the open predecessor. No other branches were edited or merged. AI-assisted: yes.

@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ AMD GPU test: failed

PR head 6e2918b merged onto main e772fb2 · tested 2026-11-05 17:26 UTC · 25 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ❌ 3,954 passed · 16 failed (1 new: 1 not compared, 10 also fail on main, 5 unstable on main) · 71 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 4,041 of 4,074 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (1407 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_graphics 94.9 s, ⚠️ agc_driver_graphics_maps_fallback 92.5 s, ⚠️ agc_graphics_profile_draw 60.1 s, ⚠️ public_headers 54.3 s

Failing tests

This PR changes test files, so each failing test was also built and run on main with only the PR's test changes applied. ✅ there means the failure comes from the PR's other changes; ❌ means the test fails on main too, so this run does not show the PR caused it.

Test With this PR Same test on main e772fb2 (main + this PR's test changes only)
agc_graphics_profile_draw ❌ failed not compared: the PR's tests do not build without its other changes
agc_graphics_profile_draw: Timeout (also failed when re-run alone), assertion and diagnostics
ctest: Timeout

[guestmem] read 0 calls 0 MiB 0.0 s compare 0 calls 0 MiB 0.0 s write 0 calls 0 MiB 0.0 s write-changed 0 calls 0 MiB 0.0 s collect 0 calls 0 MiB 0.0 s verify 1 calls 0 MiB 0.0 s query 0 calls 0 MiB 0.0 s collect-memo hits 0, collect epochs 0 collect-dirty 0 tracker waits 0 / 0 | arena 0x10000+0xfbf
[textures] sampled created: 0 from storage images, 0 cleared on the GPU, 0 snapshots (0 snapshot reads over recorded writes inside cachedTexture, 0 storage-path fallbacks); stage-A records 0: 0 fast hits, 0 full lookups; storage images 0 hits, 0 created, 0 own-object refreshes; image tables 0 reused
[guestmem] read 135 calls 6 MiB 0.0 s compare 0 calls 0 MiB 0.0 s write 44 calls 0 MiB 0.0 s write-changed 15 calls 0 MiB 0.0 s collect 0 calls 0 MiB 0.0 s verify 110137 calls 598 MiB 0.2 s query 0 calls 0 MiB 0.0 s collect-memo hits 0, collect epochs 0 collect-dirty 0 tracker waits 0 / 74705 | aren
[bufferpool] small: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB); large: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB); device: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB of 512); images: 0 hits, 0 misses, 0 evictions, 0 retained (0 MiB of 128)
[buffers] image mirrors: 0 ranges (0.0 MiB, 0 writable, 0 heap 0.0 MiB), 0 address-based builds served, 0 descriptor sub-ranges bound, 0 sparse heaps bound, 0 rebuilds, 33637 refreshes: 0 blocks compared, 0 copied, 0 refresh syncs; heap refills 0, unwatched heaps 33637, 0 heap mirrors evicted for bu
[descriptors] layouts 0 hits / 0 created, sets 0 from 0 pools and 0 dedicated pools, samplers 0 hits / 0 created
[dcc] 54 scans, 0.0 MiB scanned, 0 memo hits, 0 flush syncs, 0.0 ms; uncompressed keys stored: 0 on the GPU (0 with an unaligned head or tail), 17 on the CPU; key proofs: 0 proved, 0 scanned, 0 unstable
Unstable on main (5, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_job_manager_compute_capacity: failed in 8 of the last 10 main runs
agc_driver_pipeline_journal: failed in 9 of the last 10 main runs
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: failed in 5 of the last 10 main runs
agc_submit_progress: failed in 9 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 9 of the last 10 main runs
Failing on main too (10, not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_submit_progress
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 807 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (807 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_draw_space_reuse_held, agc_driver_address_draw_space_reuse_off, agc_driver_address_draw_space_reuse_transitions, agc_driver_address_draw_space_reuse_verify, agc_driver_address_passes, and 799 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (71)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_recorded_draw_staging: skipped, the device does not keep host imports write-watched, so the target is never resident
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_storage_pending_key_refresh: skipped, refreshes over a pending key store are not testable here
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_net_ctl_disconnected: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_device_capability: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_disabled: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROL
Reproduce
git fetch origin 6e2918bffa9d95f46f986f8417b08dbe468fe176 e772fb25cc72ee5faf77847f06bbc69533016e82
git checkout e772fb25cc72ee5faf77847f06bbc69533016e82 && git merge --no-ff 6e2918bffa9d95f46f986f8417b08dbe468fe176
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1
# the failing tests, on this merge and on main:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc_graphics_profile_draw)$' --parallel 1 -V

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 7, 2026
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 8, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — comments

The archive mapping implementation and targeted tests were inspected at head 00a2d202a33c9b09e38321962cefacd1506db1b8; material review requirements remain because not every changed file was read.

What I ran

  • Read the prepared description, commit list, manifest, diff, and selected changed-file and caller ranges through the pinned reader.
  • No build or tests were run in this review; reported test results are author-provided.

Results

Check Result Note
Changed code inspection not run Review was targeted, not exhaustive
Build and tests not run Results in the description are author-reported

Findings

Blocking

None identified in the code inspected.

Non-blocking

None.

Not verified

The full contents of core/libs/prx/libc/CMakeLists.txt, core/libs/prx/libc/include/AppArchive.hpp, core/libs/prx/libkernel/CMakeLists.txt, core/libs/prx/libkernel/File/src/Open.cpp, core/libs/prx/libkernel/File/src/Stdio.cpp, and docs/dev/debt/libc.md and docs/dev/debt/libkernel.md were not read. The full test additions in core/libs/tests/GuestKernelAppArchive.cpp were not read. No build or test was run independently.

To get this to a good state

Nothing is required. Optional: complete inspection of the unread changed-file portions before making a formal approval decision.

@ycbuzi

ycbuzi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Tested 00a2d202a3 merged into main, with the whole ctest suite on each machine below. Nothing fails that does not also fail on main on the same machine.

  • Windows Server 2022 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 2 tests failed out of 6495; 99% tests passed, 2 tests failed out of 6495. 2 of the failing tests fail on main too. run
  • Windows Server 2025 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 100% tests passed, 0 tests failed out of 6495; 100% tests passed, 0 tests failed out of 6495. run

AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 20, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — changes requested

Changes are required before merge: fix the Windows backing handle lifetime so archive mappings remain readable after the temporary descriptor is closed.

What I ran

Reviewed head 86b4b73041f30a97b5a2521b4fae801b4b141e5b using the prepared diff and repo_read.py for targeted source context. No build or test command was run; reported test results are author supplied.

Results

Check Result Note
Source review failed Windows backing lifetime defect
Build and tests not run Current-head runs reported by author

Findings

Blocking

  • core/libs/prx/libc/src/AppArchiveBacking.cpp:104: ReOpenFile opens the reader handle with FILE_FLAG_DELETE_ON_CLOSE. Windows delete-on-close marks the file for deletion when that reader handle closes, regardless of the writer handle still being open. Map then closes the returned descriptor when its local ArchiveMappingDescriptor is destroyed (core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp:62-68), so the backing file can be deleted immediately after mmap returns. For Windows private mappings, MapPrivateFileCopy reads from that descriptor only after returning from the materializer, and Windows shared mappings also need the backing file to stay present for DoMapFileBacked_nid_no_patch; this can cause mapping failure or break later file-backed operations. Avoid delete-on-close on the reader handle and retain a lifetime mechanism that removes the temporary file only after the mapping source is no longer needed.

Non-blocking

None.

Not verified

  • No commands or tests were run in this review. Current-head Windows harnesses and syntax checks are reported in the PR description, not independently verified here; end-to-end guest mmap and fresh Linux/macOS execution are reported as pending.
  • Reviewed all 10 changed files listed in manifest.json; all are marked included. The description, commits, manifest, and diff were read. files.json was not available from the review reader.
  • The remaining 7 lines of description.md and test implementation outside the targeted ranges were not read.

To get this to a good state

Remove the reader handle's delete-on-close behavior and ensure temporary backing storage remains available for the lifetime required by the Windows mapping implementation. Then rerun the Windows archive mmap tests, including mapping survival after the source descriptor closes.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@MarcZX10 I updated the Windows backing lifetime in 4a2b14298c386cf90332d35bbc2e5c8314d2993f. The reader opens with GENERIC_READ and no delete-on-close flag. The writer alone requests deletion, and shares delete access with the reader. The private path finishes copying before the descriptor closes. The shared path installs a section-backed view before that close.

On Windows 11 build 26300, both the read-only and executable native-view tests passed after closing the section handle and descriptor. The backing directory was clear after unmap. Descriptor reads and truncated-input cleanup also passed. The native lifetime reproducer passed with the previous flags on this machine too. The registered guest CTests for the new head are queued behind the shared Windows build mutex; the PR body records the distinction in coverage.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@MarcZX10 The requested end-to-end Windows rerun passed at 4a2b14298c386cf90332d35bbc2e5c8314d2993f: 26/26 registered guest CTests on Windows 11 build 26300 with WinLibs GCC 15.2 Release. guest_kernel_app_archive_mmap passed its shared and private mapping data checks after descriptor close and replacement, along with protected destination and write-watch checks. The backing failure and damaged archive modes passed as well. The PR description now records the exact-head result.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The inspected archive mapping and read paths appear sound; the prepared report records successful Windows checks, while I did not run checks in this review.

What I ran

  • Reviewed head 4a2b14298c386cf90332d35bbc2e5c8314d2993f using the prepared description, commits, manifest, diff, and targeted source ranges through repo_read.py.
  • No commands or tests were run by me. The Windows test results below are reported by the author.

Results

Check Result Note
Targeted source review passed Mapping, backing and checked reads inspected
Windows CTest passed 26/26, author reported
Linux and macOS execution not run Fresh execution remains pending

Findings

Blocking

None in the inspected code.

Non-blocking

  • The materialization path intentionally holds the shared descriptor mutex while copying the requested archive window. Large mappings can therefore serialize reads, seeks and maps through duplicate descriptors; the description records this tradeoff and does not claim a performance improvement.

Sources

Not verified

  • I did not run builds or tests. Windows 11 / WinLibs GCC 15.2 results, including 26/26 registered guest CTests, are author reported in description.md, not independently verified here.
  • Fresh Linux and macOS execution, physical console behavior, and the full repository test suite were not verified.
  • All 10 changed files marked included in manifest.json were read through the prepared diff or targeted source reads; full source text was read for AppArchive.cpp, PosixMemory.cpp, and ArchivedFile.cpp. I did not read every line of GuestKernelAppArchive.cpp, AppArchiveBacking.cpp, Open.cpp, Stdio.cpp, either CMake file, or the debt document. files.json was unavailable through the reader, so excluded-by-rule files were not verified.

To get this to a good state

Nothing is required. Optional: consider measuring the mutex hold time for large mappings before changing the serialization strategy.

@oneandonlydean
oneandonlydean merged commit ca2c49e into boykopovar:main Nov 21, 2026
24 of 34 checks passed
Romannachwievor added a commit to Romannachwievor/AnyPS5 that referenced this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants