Skip to content

feat(libc): implement lfind and lsearch - #11621

Merged
oneandonlydean merged 13 commits into
boykopovar:mainfrom
B-Howell:codex/opus-missing-functions
Nov 4, 2026
Merged

oneandonlydean merged 13 commits into
boykopovar:mainfrom
B-Howell:codex/opus-missing-functions

Conversation

@B-Howell

@B-Howell B-Howell commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement lfind and lsearch for the libc PRX, matching POSIX.1-2008 and FreeBSD 11 lsearch.c: linear scan returning the first matching element, and for lsearch, append the key and increment *nelp on a miss. A null nelp throws std::invalid_argument. lfind returns null for *nelp == 0 before checking unused arguments. For nonempty lfind and every lsearch call, null base/key/compare or a zero size throw std::invalid_argument. A *nelp * size span past SIZE_MAX throws std::overflow_error before comparator calls or element access. For lsearch, a successful match returns immediately; only after the linear scan finishes with no match does the append path check that (*nelp + 1) * size still fits in SIZE_MAX, so an existing-element match never requires space for an extra element. Documented in docs/dev/debt/libc.md.

Tested

Main refresh at eb364c8536b8 (2026-11-02)

Head eb364c8536b83b72d8f8754a75488bb0ed2e198a ordinarily merges previous head 0aecada0f0fe8dd2ea79a85f5983d7fb1ce34b2e with upstream main 88e804b0a7df1f1ac373a9e2f72fb378d925fdd4, after #9688 rewrote the neighbouring qsort_s entry in docs/dev/debt/libc.md. That entry was the only conflict: this PR's lfind and lsearch entry stays directly before main's new text, which is kept verbatim. The diff against main is still the four owned files, and its added lines are identical to the previous head's. tools/check_conventions.py from this main passed. No new local build or runtime result is claimed for this head; hosted CI at this head is pending after push.

Main refresh at 0aecada0f0fe (2026-11-01)

Head 0aecada0f0fe8dd2ea79a85f5983d7fb1ce34b2e / tree 5e2ad2f2207125ea17b4c9d8571ad941f94ed4b1 ordinarily merges previous public head b8106dd96f42c6ba387036d6d06bc7faa1daf6dc with upstream main b6e3f68173c767f692f6c04eef04c73eab424e04. #13220 has landed: its original commit e9f09f54fabb6408d3e2711b8df10c10112ab00e is an ancestor of that main, so the write-watch registration fix now comes from main and this PR no longer changes core/libs/tests/write_watch/CMakeLists.txt. The remaining diff against main is the four owned files (Api.hpp, FileAndHeap.cpp, GuestSearch.cpp, docs/dev/debt/libc.md); its added and removed lines in those files are identical to the previous head's changes. Git's three-way merge was clean; GitHub reported the previous head as conflicting, and a merge using only the older main base conflicts on that shared CMake file. tools/check_conventions.py from this main passed against this head. No new local build or runtime result is claimed for this head; hosted CI at this head is pending after push. Earlier results below keep their original pins.

Main refresh at e4b645a6f531

Head e4b645a6f5316e9aff461654f7f5dcb9b43000c9, tree 45ac9db4e287db5761749db5cbaa23491e11f121, ordinarily merges 0b349fa4c140634267345d7d43ee18cb02de48b8 with main c0fb4a6aad1012b7e2abecaf2949e3d26c0e525d, observed at 2026-10-30 20:15:30 UTC; published 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7 remains an ancestor. This is the documented main baseline for this refresh; later remote-main advances are not certified. The four owned contribution files and their additions remain unchanged. Earlier evidence below keeps its original pins.

This new head has source-equivalence evidence: all 82 direct compiled libc/search/nid_patcher source inputs match tested 0b349fa4c140634267345d7d43ee18cb02de48b8, and the libc, NID and third-party source trees match. This is not a new-head binary or test pass. Runtime evidence stays at that exact 0b349fa4 head: Windows/WinLibs GCC 15.2.0 r7 and WSL Ubuntu 22.04/GCC 11.4, Release, focused build and ctest -R '^(guest_search|public_headers)$' -V -j1 --repeat until-fail:3 --timeout 30 --no-tests=error passed 12 selected executions across both OS = 6 native guest runs + 6 audit-only header runs, with no failures/skips. No fresh global-header audit at e4b645a6 is claimed.

The #11621-before-#9935-before-#12574 order, other scoped/shared-file qualifications, future combined validation, reviewer acceptance and actual upstream landing remain separate. The historical approval at 921acc6 is not approval of this new head.

The audit-only case retains its generated 90-second timeout; the 64 header compile batches are excluded. Fresh hosted CI at the new head is pending after push. No new console, GPU, title, macOS, whole-product or full-suite result is claimed.

Current main integration: 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7, tree 33e9ef395f6582282fd4a72b579efc15480547f4, normally merges main 4c8cff191609bc5f28bf9ee2f93672b531285aa4 into published head 9e09e7efe714275ca7cce7b2f48c3282b38bee07. The owned implementation, declaration and fixture additions are unchanged.

Windows 11, WinLibs GCC 15.2.0 r7, Release: cmake --build build --target guest_search_tests --parallel 2 passes. ctest --test-dir build -R '^(guest_search|public_headers)$' -V --repeat until-fail:3 passes 2/2 cases, each three repetitions (six passes, no skips), in 46.62 seconds. Conventions against current main pass. No fresh Linux, console, full-suite, title or GPU result is claimed.

The historical evidence below retains its original pins/toolchains. The declared #11621-before-#9935-before-#12574 chain remains visible in the later PRs. Current #9688 at 1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6 changes independent qsort/qsort_s helpers and adjacent debt; complete shared-file patches show no lfind/lsearch implementation dependency. Its earlier order proposal is unanswered, not an established dependency or a standalone readiness blocker. Preserve both search and sort debt when reconciling the adjacent lines. Other current-head overlap deltas, future combinations and reviewer acceptance remain separately qualified. No all-comments-complete or readiness claim is made.

Earlier integrated-head evidence:

Windows 11 Pro, MSYS2 UCRT64 GCC 16.2.0, integrated head 9e09e7efe714275ca7cce7b2f48c3282b38bee07 (main 319621ba2e578bd053b0baba2877fe70520e0737): cmake --build build-focused --target guest_search_tests --parallel 2 passed; ctest --test-dir build-focused -R '^guest_search$' -V passed 1/1 (guest_search, test 515, 0.03 sec). python tools/check_conventions.py --base origin/main passed after the merge commit. No new Linux or console execution is claimed for this integrated head.

Earlier published-head Windows evidence: Windows 11 Pro, MinGW UCRT64 (gcc 16.2.0): built guest_search_tests and ran ctest -R "^guest_search$" -> 1/1 Test #414: guest_search ..... Passed 0.05 sec. Covers duplicate-first-match, zero-count no-op, byte-exact appended payload, zero-count seed, and that the pre-loop overflow guard fires with calls == 0 and *nelp unchanged. Not run on a console.

Linux (WSL Ubuntu 22.04, GCC 11.4, Release) at a5be9ab: ctest -R '^guest_search$' passed. With the previous head 921acc6 and this head's GuestSearch.cpp, the same test aborts with lfind: invalid arguments, so the null-base zero-count case is covered by the real libc.prx build.

Write-watch CI prerequisite

This update merges the original #13220 commit (e9f09f5) as a second parent. It removes only the duplicate execute-fault and read-fault registrations from the shared write-watch CMake file; the function change remains the first-parent history. Historical function-test results retain their original pins as recorded above; the latest paired runtime evidence for #11621 is at 0b349fa, not e4b645a or this prerequisite merge. A separate configure-only Windows/Linux comparison generated all 18 unique test registrations after the fix, with no fixture build or runtime tests. The hosted macOS checks on this updated head are pending; no macOS runtime result is claimed here.

#13220 landed in upstream main on 2026-11-01. Earlier heads carried its original commit e9f09f54fabb6408d3e2711b8df10c10112ab00e as a second parent; after the 2026-11-01 main refresh above, the fix comes from main and this PR no longer changes the write-watch CMake file. The historical configure-only comparison and the pins recorded here are unchanged.

Candidate qualification at b8106dd96f42

Candidate b8106dd96f42c6ba387036d6d06bc7faa1daf6dc / tree 452bc21d8a66b75bf5f40d662471a882a1a37512 ordinarily merges previous public head 9c151b9c5892a1c00749af1614a7bcc5fd04c59d with frozen upstream-main snapshot f776fddcffd1cfece220ecdd894371988b164f6a. This result is for that frozen composition, not later upstream-main tips. Windows Release with WinLibs GCC 15.2.0 r7, CMake 4.4.4 and Ninja 1.13.2 configured the existing b12250a cache and built guest_search_tests with two jobs. ctest --test-dir b12250a -R '^guest_search$' --output-on-failure -V passed 1/1 (guest_search, test 681; 0.04 seconds for the test, 0.14 seconds total), using the freshly built candidate libc.prx from CTest's generated working directory. python tools/check_conventions.py --base origin/main completed with 0 errors and two existing debt-length warnings. This is a focused candidate-only Windows result, not a main-vs-candidate comparison, Linux result, full-suite result or hosted-CI result.

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

  • 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: none

  • Fixes: none

  • Unblocks: none

  • GPUs tested: n/a

  • AI-assisted: yes (Claude Opus 4.7 + Codex)

B-Howell and others added 2 commits October 26, 2026 19:02
Add FreeBSD/POSIX lfind and lsearch for the libc PRX, with explicit
guards against null arguments, zero element size, and span arithmetic
that would overflow size_t.  lsearch validates the existing search
range before any comparator call, then separately checks the append
capacity so a matched element never requires room for an extra one.

Extend guest_search to cover first-match on duplicate keys, zero-count
no-op, byte-exact appended payload, zero-count seed, and that the
overflow guard fires without touching element memory or invoking the
callback.  Document the exports in docs/dev/debt/libc.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AGENTS.md allows only #endif and namespace-end comments.  Drop the
explanatory lines added alongside the new lfind/lsearch exports and
their guest_search coverage, and tighten the debt entry below the
1000-character limit flagged by tools/check_conventions.py.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Progress report (5b1d381 → 8553f32)

📈 System libraries: 26.69% (+0.0039%, +2 implemented functions)

✅ 2 implemented
Library Name
libc lfind_nid_postfix
libc lsearch_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libc 1628/1647 (98.85%) 1630/1649 (98.85%) +0.0014%

@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 head 921acc674910090fb1368b6fd313cfc541f54398. The search loops compare the key against elements in table order, return the first match, leave nelp unchanged on a hit, and append/increment only on an lsearch miss. The checked multiplication bounds are applied before element access; the append bound is applied only after a miss. The tests cover duplicate first-match behavior, unchanged data/count on a hit, append payload/count, empty-table behavior, and overflow rejection before comparator or memory access. I also checked the public declaration and debt entry against the implementation.

Validation run locally on Linux (Release): configured the PR worktree, built guest_search_tests (which also built libc.prx), and ran ctest -R ^guest_search$ → 1/1 passed. The public-header audit and all 64 compile batches passed (65/65). Hosted conventions, intake, labels, report, register-context, write-watch, ASan, and the completed relinker jobs pass; hosted Linux/Windows full product builds are skipped by path policy. I attempted the documented manual full-build dispatch, but GitHub denied it because the account lacks repository admin rights. The author reports the focused Windows test; I did not independently rerun it.

@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 12574 docs/dev/debt/libc.md L109
PR 12598 docs/dev/debt/libc.md L109-110

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 5021 docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 6819 docs/dev/debt/libc.md
PR 7081 core/libs/prx/libc/src/FileAndHeap.cpp
docs/dev/debt/libc.md
PR 7386 docs/dev/debt/libc.md
PR 7447 core/libs/prx/libc/src/FileAndHeap.cpp
docs/dev/debt/libc.md
PR 7715 docs/dev/debt/libc.md
PR 8150 docs/dev/debt/libc.md
PR 8965 docs/dev/debt/libc.md
PR 9340 docs/dev/debt/libc.md
PR 9371 docs/dev/debt/libc.md
PR 9447 docs/dev/debt/libc.md
PR 9526 core/libs/prx/libc/src/FileAndHeap.cpp
docs/dev/debt/libc.md
PR 10405 core/libs/prx/libc/src/FileAndHeap.cpp
docs/dev/debt/libc.md
PR 10780 core/libs/prx/libc/include/Api.hpp
docs/dev/debt/libc.md
PR 11332 docs/dev/debt/libc.md
PR 11724 docs/dev/debt/libc.md
PR 12849 docs/dev/debt/libc.md
PR 13449 docs/dev/debt/libc.md
PR 13486 core/libs/prx/libc/include/Api.hpp
core/libs/prx/libc/src/FileAndHeap.cpp
docs/dev/debt/libc.md
PR 13794 docs/dev/debt/libc.md
PR 13804 docs/dev/debt/libc.md
PR 13809 docs/dev/debt/libc.md
PR 14212 docs/dev/debt/libc.md
PR 14559 core/libs/prx/libc/src/FileAndHeap.cpp
PR 14560 core/libs/prx/libc/src/FileAndHeap.cpp

@oneandonlydean

Copy link
Copy Markdown
Collaborator

In lfind_nid_postfix, please return nullptr when *count == 0, before the key/base/compare/size checks, as bsearch_nid_postfix does. That way a lookup in a not-yet-allocated table (base NULL, count 0) is a miss instead of an exception. Keep the throws for count > 0, and add one GuestSearch.cpp case: lfind(&key, nullptr, &zero, sizeof(Record), Compare) == nullptr with zero comparator calls.

Treat a zero *nelp as a miss before validating key, base, compare or
size, matching bsearch so a lookup against a not-yet-allocated table
(base null, count zero) returns null instead of throwing. Cover it with
a GuestSearch case that exercises null base with zero count and zero
comparator calls.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@B-Howell

Copy link
Copy Markdown
Contributor Author

Addressed in a5be9ab on codex/opus-missing-functions:

  • lfind_nid_postfix now returns nullptr for *count == 0 before the key/base/compare/size checks, mirroring bsearch_nid_postfix so a lookup against a not-yet-allocated table (null base, zero count) is a miss rather than a throw. The null-nelp throw stays, and all argument/overflow throws are kept for *count > 0.
  • Added the requested GuestSearch case: lfind_nid_postfix(&probe, nullptr, &empty, sizeof(Record), Compare) == nullptr with calls == 0.
  • Updated docs/dev/debt/libc.md so the lfind/lsearch bullet records the new ordering.

Diff of the behavior change:

void* APS5_VABI lfind_nid_postfix(const void* key, const void* base, size_t* count,
    size_t size, int (APS5_VABI *compare)(const void*, const void*)) {
    if (!count) throw std::invalid_argument("lfind: null element count");
    if (*count == 0) return nullptr;
    if (!key || !base || !compare || size == 0)
        throw std::invalid_argument("lfind: invalid arguments");
    ...

New test lines (GuestSearch.cpp):

calls = 0;
Require(lfind_nid_postfix(&probe, nullptr, &empty, sizeof(Record), Compare) == nullptr);
Require(calls == 0);

python3 tools/check_conventions.py --base origin/main → All conventions checks passed. No local compiler was available on this host for a fresh ctest run; CI (windows-msys2, Linux/macOS relinker + ctest jobs) will re-exercise guest_search with the new assertion on this commit.

AI-assisted: yes (Claude Opus 4.7).

@B-Howell

Copy link
Copy Markdown
Contributor Author

Local test results for a5be9ab, Linux (WSL Ubuntu 22.04, GCC 11.4, Release, -DBUILD_TESTING=ON):

Commit ctest -R '^guest_search$'
a5be9abc16 (this head) Passed
921acc6 (previous head) with this head's GuestSearch.cpp Subprocess aborted: std::invalid_argument: lfind: invalid arguments

The new zero-count case (null base, *count == 0, comparator not called) fails without the fix and passes with it, in the real libc.prx build rather than an extracted copy. I haven't run the Windows or macOS full builds locally.

AI-assisted (Claude Code).

@B-Howell

B-Howell commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Manual follow-up to the skipped comparisons in the overlap report (comment6430605462). Reviewed target head: a5be9abc167cb9966fad0072b1ed5a608ad48e39.

I inspected the listed shared-file patches for all 26 candidates. No duplicate target export/implementation was found in this scoped review. The table records the specific shared-file changes and integration requirements; shared debt/header changes still need to preserve both sides. This is not a claim that every pair merges cleanly or that a combined branch has been built/tested.

This follow-up addresses the skipped-comparison request only. Existing CI limitations, dependency ordering and outstanding re-review requirements remain in force; approvals or tests from older heads do not become current-head evidence through this audit.

Update: the refreshed bot report added #10002 and #12397. Their listed debt patches are now included below at the recorded heads; the earlier24candidate assessment remains unchanged. This delta review does not close the separate landing-order coordination.

Candidate heads, shared files and manual dispositions
Candidate Reviewed head Shared files Disposition
#5021 151294f979ab00aaff2f702314425caf61a72790 libc.md Adds a separate ARM64 CRT-profile debt entry: x87 strtold/wcstold exports remain excluded on ARM64, and extended-format arguments reject before host decoding. Preserve both entries and architecture qualifications; no implementation compatibility conclusion follows from this debt-only scope.
#6713 668d51adbdb91248f49fdd28acbfd0b85adb98cd libc.md Debt-only statements in libc.md concern Application heap without process parameters. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#7081 e6f5d4c71b6ff42a43ee1c90b9b3fc912efdad7b FileAndHeap.cpp, libc.md FileAndHeap.cpp changes fopen_s constraint-handler calls. Debt-only statements in libc.md concern localeconv; set_constraint_handler_s. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both distinct changes during integration; this audit does not establish clean merges or combined test success.
#7386 bf7352321cf85d1bfdfe402f3fba7b2d90c683eb libc.md Debt-only statements in libc.md concern The scanf family. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#7447 dead12ebad24a3c4b01a05c14ab60cc06aacaf7d FileAndHeap.cpp, libc.md FileAndHeap.cpp adds CloseOwnedStream and archive-aware fopen handling. Debt-only statements in libc.md concern app0.zar. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both distinct changes during integration; this audit does not establish clean merges or combined test success.
#7648 bdf0d319632cb330c4ca909fe9d76577d6e58ae9 libc.md Debt-only statements in libc.md concern std::_Throw_C_error. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#7715 783fa9b83f5f0ac617d4b0f05321a34c1279cb7f libc.md Debt-only statements in libc.md concern getenv, setenv, unsetenv, putenv. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#8150 6a9b1285c596904698bb0511c14f7c04302b708b libc.md Debt-only statements in libc.md concern fopen of /dev/random and /dev/urandom. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#8937 27aeb1feb4a533bb0d8ca20b9450ea4c0cc45efc Api.hpp, libc.md Api.hpp changes fesetenv_nid_postfix. Debt-only statements in libc.md concern fesetenv. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve lfind/lsearch plus distinct API declarations/includes; run integrated guest search tests.
#9371 9ea4c6561be22466166fb26fa61cd2eb0d23f2cf libc.md Debt-only statements in libc.md concern Windows link before ... These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#9447 2dc7b701a4d72515be281c8e469fb14c5a588d63 libc.md Debt-only statements in libc.md concern std::__sce_v2::_Thrd_hardware_concurrency, _Cnd_timedwait, chrono::steady_clock::now_v1_compat. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#9526 1da5b7cd5c8904a515d275f1677f7fbaedf8fe34 FileAndHeap.cpp, libc.md FileAndHeap.cpp adds the distinct versioned _Fiopen mode-table wrapper. Debt-only statements in libc.md concern std::__sce_v2::setw; std::__sce_v2::_Fiopen; std::__sce_v2::_Xregex_error. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both distinct changes during integration; this audit does not establish clean merges or combined test success.
#9929 57c6df1f5620c34835e450490fbc574c854e74d1 libc.md Debt-only statements in libc.md concern syslog. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#10253 5b96a875888056c5bd758270593be17d1a3f5542 libc.md Debt-only statements in libc.md concern asin and acos. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#10324 5e32fdc2a5ccd4050a6a2e7f46f94e31966f8cca Api.hpp, FileAndHeap.cpp, libc.md Api.hpp changes fwide_nid_postfix. FileAndHeap.cpp adds byte orientation to fread/fwrite/fputs. Debt-only statements in libc.md concern fwide. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve lfind/lsearch plus distinct API declarations/includes; run integrated guest search tests.
#10433 1e32d23a9c221fffeca70ba8a7f709b0057dbd77 FileAndHeap.cpp, libc.md FileAndHeap.cpp factors directory handle opening and supports directory freopen. Debt-only statements in libc.md concern fopen and freopen. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both distinct changes during integration; this audit does not establish clean merges or combined test success.
#10620 2a999da21f5650bfb9aacf88c0d0194d3c5d66ad FileAndHeap.cpp, libc.md FileAndHeap.cpp factors random-device path/null-device handling and adds random-device freopen. Debt-only statements in libc.md concern fopen and freopen of /dev/random and /dev/urandom. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both distinct changes during integration; this audit does not establish clean merges or combined test success.
#11332 793a55ba18497e36f1038242dae9d7e707641f35 libc.md Debt-only statements in libc.md concern snprintf and vsnprintf. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#11625 e97bbf045122e4326b0f5332a9844df37bd1d5dc libc.md Debt-only statements in libc.md concern app0.zar. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#11849 cd97f141d91cbd1e47f670a3d4eec4c1cfeed609 libc.md Debt-only statements in libc.md concern asinl. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#11850 663230eaafcdc8da7e52b6067e287261c335bb9b libc.md Debt-only statements in libc.md concern reallocalign. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#11870 3670a1509408a983806f09933d5be619263bb44b libc.md Debt-only statements in libc.md concern malloc_stats_fast. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve both debt changes; no implementation integration inferred from debt-only scope.
#11872 21d5a977f993346c5f762d31eebfb15ce349f76f Api.hpp, FileAndHeap.cpp, libc.md Api.hpp changes #include "prx/libc/include/JumpBuffer.hpp". FileAndHeap.cpp adds descriptor admission and closing callbacks. Debt-only statements in libc.md concern setjmp, longjmp. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve lfind/lsearch plus distinct API declarations/includes; run integrated guest search tests.
#11969 560f498196e7db59ef8b4f41463105dadb96e15a Api.hpp, FileAndHeap.cpp, libc.md Api.hpp changes #include "prx/libc/include/JumpBuffer.hpp". FileAndHeap.cpp adds descriptor admission and closing callbacks. Debt-only statements in libc.md concern setjmp, longjmp. These are documentation claims, not independently reviewed candidate implementations. No scoped lfind/lsearch declaration, body or debt duplicate identified. Preserve lfind/lsearch plus distinct API declarations/includes; run integrated guest search tests.
#10002 9bbf84ead3b761fba399c40788bb783b98934e64 libc.md Adds asinhf msun range-reduction debt with system-library/FMA qualifications; this is distinct from the target lfind/lsearch debt entry. Only the listed debt patch was reviewed; implementation compatibility was not assessed. Preserve both entries and their measurement/platform limitations.
#12397 f2548977ea559a13c157c8ad0e5109983745dccd libc.md Updates narrow printf/unknown-conversion debt and adds a printf-length-modifier qualification. These changed paragraphs are distinct from the target lfind/lsearch debt entry. Only the listed debt patch was reviewed; implementation compatibility was not assessed. Preserve both entries and their measurement/platform limitations.

AI-assisted: yes (Codex).

Current-target delta addendum (October 28): target 9e09e7efe714275ca7cce7b2f48c3282b38bee07, integrated main 319621ba2e578bd053b0baba2877fe70520e0737. The historical26-row table above retains its original pins. The added/removed implementation, declaration and GuestSearch.cpp contribution lines are unchanged after main integration. The debt wording now correctly separates span overflow (before comparator/access) from append-capacity overflow on a miss (after the scan, before copy/count update); this changes the description, not the implementation contract.

The refreshed skipped list adds #11270 at 2eb8d8d12ff470331b8fed5da1126215ec935214 and #11892 at 6219aaaff1520be4d484d6b618c3c3977024be58. I reviewed their complete listed libc.md patches: the former replaces _LLog debt with bundled-library/Dinkumware and x87-precision/error qualifications; the latter updates decimal wcstod ERANGE behavior based on eleven title libraries, but its final unverified-hexadecimal sentence is stale relative to landed #12291. When integrating #11892, compose that eleven-title decimal qualification with main's PPSA08329-only hexadecimal measurements on a Linux host and glibc 2.35 rounding limitation; keep console wcstod explicitly unmeasured. The existing #11892 follow-up requests focused math/wide-string tests, including inherited hexadecimal-underflow cases, on the future combined head; those tests remain pending. These paragraphs are distinct from lfind/lsearch. Keep both measurement sets with the search paragraph; no runtime dependency or implementation compatibility follows from this debt-only scope, and the candidates' reported measurements were not independently repeated.

Retained #7648 moved to 2b34b0217219d34a2aca78d07135039dc24468d9 from bdf0d319632cb330c4ca909fe9d76577d6e58ae9. Its _Throw_C_error debt addition retains the mappings and SDK limit while generalizing the named-title provenance wording. Preserve it and the search contract; this audit does not verify its binary evidence. #11850/#11870 are absent from the current bot list; their historical rows above remain history.

The four compared heads in comment6475613786 are unchanged. Comment6475838866 confirms #11621 first for #9087/#9935/#10270, with those authors retaining the search paragraph and rerunning after integration. #9688's order remains unconfirmed; no agreement is inferred from adjacent debt. Current-head local guest_search 1/1 remains separately qualified, with no new Linux/console execution. This source-only delta review adds no combined tests, current approval or all-CI-pass claim and does not clear remaining integration obligations.

AI-assisted: yes (Codex).

@B-Howell

B-Howell commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Follow-up to the actual compared conflicts in overlap comment6430605462, for this PR at a5be9abc167cb9966fad0072b1ed5a608ad48e39.

I inspected the listed shared-file patches for 4 compared candidates at the heads below. This is separate from the earlier skipped-comparison review.

  • fix(libc): follow snprintf_s and sscanf_s constraints as measured on a PS5 #9087 (ec862a495abf1248277185e224b98287c20729ee): Candidate changes secure printf/scanf bounds, returns and constraint-handler measurement notes (snwprintf_s, snprintf_s/vsnprintf_s, set_constraint_handler_s, sscanf_s/vsscanf_s and wide scanning). Target inserts lfind/lsearch debt between the constraint-handler and qsort_s entries. Preserve target search argument/overflow contract and candidate measurement/handler qualifications; no duplicate search declaration/implementation is present in this debt-only scope. Retain all distinct paragraphs during manual debt reconciliation. No runtime dependency established from this document-only comparison.
  • fix(libc): sort like the console's qsort and qsort_s #9688 (03874cf1c5e43c18969364be032dc1e8371fe1c9): Candidate replaces qsort debt with introsort/comparator-order observations and revises qsort_s sorting/zero-size qualifications. Target adds a distinct lfind/lsearch paragraph adjacent to qsort_s. This is search versus sort documentation, not duplicate target behavior. Preserve revised qsort/qsort_s notes plus lfind/lsearch insertion. Do not infer code compatibility or predecessor order from adjacent debt.
  • fix(libc): write the constraint message and return from the default handler #9935 (7aa063d91cb079e5d82cdb64aff5731288b0406f): Candidate replaces the set_constraint_handler_s default-abort assumption with title-library write-and-return versus system-library termination observations. Target adds lfind/lsearch immediately after that entry. Different contracts; target search exceptions are not constraint-handler dispatch. Keep both updated handler debt and new search debt. No runtime dependency or author coordination agreement established by this scope.
  • fix(libc): bound and report the Annex K copies as measured on a PS5 #10270 (ee3d2ffb81d5b5e7a87e167bcc8f37c4f2d0540a): Candidate removes the obsolete secure-copy size-limit debt, revises narrow/wide concatenation overlap and default constraint-handler debt. Target adds lfind/lsearch after the handler entry. The candidate does not replace that search debt entry. Retain candidate removals/updated measurements and target search paragraph; avoid restoring stale handler assumptions while resolving context conflicts. No implementation verdict follows from this debt-only scope.

These scoped findings do not establish clean pairwise merges or a successful combined build/test. They do not clear other review, CI, dependency or current-head verification obligations.

@orezraey @JJenkx To settle the landing order required by CONTRIBUTING, I propose #11621 first, then #9087/#9688/#9935/#10270 preserve the search paragraph while reconciling their debt edits. These scoped documentation overlaps do not require their implementations for this search fix. Please confirm or propose another order; this is a proposal, not an agreement. I will record the confirmed order and refresh my affected branches before readiness.

AI-assisted: yes (Codex).

New compared-scope delta (October 28): #11621 target 9e09e7efe714275ca7cce7b2f48c3282b38bee07 and #12574 at e1dbfa0753042fcbdfb6cda981b574ae1e887b33, reviewed against main 319621ba2e578bd053b0baba2877fe70520e0737. The four original rows and their historical pins above remain unchanged.

I reviewed only #12574’s listed docs/dev/debt/libc.md change. It revises the existing set_constraint_handler_s paragraph: the old asctime_s/ctime_s argument-check sentence is removed, while the default-handler/module-state qualifications and the unverified ctime_s outcome when localtime_s fails remain. #11621 inserts the independent lfind/lsearch paragraph immediately after that entry. The shared-file-only merge preview exits 1 at this adjacent paragraph boundary.

Resolve this documentation conflict by retaining both the candidate’s revised constraint-handler paragraph and the complete target search paragraph, including its first-match/append behavior, argument and overflow limits, and unverified console behavior. This scoped review does not validate #12574’s implementation or repeat its reported measurements. It establishes no implementation dependency or landing order and no clean whole-PR merge or combined build/test result.

Existing author orders and remaining actions stay as recorded; #9688’s order remains unconfirmed. The separately recorded current-head guest_search result is unchanged and is not a combined test with #12574. No remaining review, integration or readiness obligation is cleared by this addendum.

AI-assisted: yes (Codex).

Dependency-chain check: #9935 at 7aa063d91cb079e5d82cdb64aff5731288b0406f currently lists #11621 in its checklist, and its author confirmed #11621 first. #12574 at e1dbfa0753042fcbdfb6cda981b574ae1e887b33 explicitly depends on #9935. The existing declared chain is therefore #11621 → #9935 → #12574; this records that chain rather than introducing a new runtime dependency or borrowing a combined test result. The relevant authors still need to retain the search debt when integrating later branches. The separate #9688 order remains unconfirmed.

October 29 current-main and new compared-scope follow-up

Current integration 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7 merges main 4c8cff191609bc5f28bf9ee2f93672b531285aa4 normally. The lfind/lsearch implementation, declarations and fixture remain byte-equivalent to the earlier owned change; only main integration is new.

I read the complete listed docs/dev/debt/libc.md patches for two newly compared rows:

  • fix(libc): check qsort_s arguments as titles' libc.prx does #12598, head c6cfa7cfd9dbff57752dab24b5574af9d8037822, base 157b02c4f1803e9d2cd757677b9a805961203fc4: replaces qsort and qsort_s qualifications. Preserve the candidate's bundled-library introsort/comparator observations and its narrowly qualified PPSA07923 host SIGFPE/zero-size observation, unmeasured callback/canary effects and SDK limits. Keep the independent complete lfind/lsearch paragraph immediately before qsort_s, including empty lfind, argument checks, span-before-scan versus append-after-miss overflow checks and unverified console behavior. This is adjacent search/sort documentation; it establishes no runtime dependency or author agreement and does not independently repeat the candidate's measurements.
  • fix(libc): check sprintf_s and vsprintf_s as titles' libc.prx does #12622, head 1dd0d4a860eefb9ee7834d67e110c1e0e20cfc6b, same base: revises narrow secure-print constraints/returns/handler behavior, separates wide size assumptions, removes the old vsscanf_s debt entry, records distinct system-versus-bundled default-handler behavior, and adds the short-wide-%c qualification. Preserve those additions/removals and their measurement limits while retaining the complete independent search paragraph after set_constraint_handler_s. Do not restore the obsolete default-abort assumption or obsolete vsscanf_s paragraph during conflict resolution. This listed-file review adds no secure-format implementation verdict, repeated hardware measurement, pairwise merge or combined test claim.

The current bot scope is not fully cleared: retained candidate heads and newly skipped rows still need current-patch reconciliation. Historical rows and test pins remain unchanged. #9688 now has head 1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6; its earlier compared row remains pinned to 03874cf1c5..., and its author's test updates do not establish agreement on our proposed order. The separately declared #11621 -> #9935 -> #12574 chain remains visible in current checklists; #9935 is still 7aa063d91cb079e5d82cdb64aff5731288b0406f, and #12574 is now 6b2c35188f6706790c39f7ba302fc92148fbc7c6. Their future integration must retain search debt. No all-comments-complete, new reviewer acceptance or readiness claim follows.

AI-assisted: yes (Codex).

Current dependency scope clarification — October 29

At #11621 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7, I reread the complete shared-file patches for #9688 1c8ac1874c0ed5ccafef5112d59da6739d4a2fb6 and #9935 7aa063d91cb079e5d82cdb64aff5731288b0406f. #9688 changes qsort/qsort_s and their private helpers; neither search export calls those helpers, and its patch adds no search declaration, implementation or fixture change. Retain its two updated sort debt entries alongside the complete independent search paragraph. This updates the older #9688 row's source scope; it does not repeat its bundled-library measurements or its author's runtime results.

#9935 still declares #11621 for merge order only, and its author confirmed #11621 first in comment6475838866. It changes the default handler and its dedicated safe-errors fixture, not either search loop. Its revised handler paragraph and the complete search paragraph must both survive the adjacent documentation edit. #12574 currently at 6b2c35188f6706790c39f7ba302fc92148fbc7c6 still explicitly depends on #9935: the declared chain remains #11621 -> #9935 -> #12574. These are distinct from an implementation dependency of #11621.

No #9688 author agreement was found. The old proposal remains unanswered; source inspection does not convert it into consent, but it also does not establish a runtime dependency or a standalone requirement to hold this search PR. No duplicate author ping or private combined build was needed to answer this scoped dependency question. Current unrelated bot rows, other integration questions and approvals remain outside this clarification; historical tests retain their original pins. No new test, all-overlaps-clear or readiness claim.

AI-assisted: yes (Codex).

October 30 - additional scoped overlap follow-through

Frozen target #11621: 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7. The historical 2026-10-30T01:32:51Z inventory of bot comment6430605462 contained 42 candidate rows and identified 16 new rows relative to the named earlier snapshot. The latest captured update (2026-10-30T03:36:04Z) contains 40 rows: 5 compared and 35 skipped. It removed #11625 and #12688, added no candidates, and changed no retained shared-path rows. The #12688 findings below remain pinned historical source evidence.

The source heads that moved during preparation have been refreshed at the exact pins below, including additional actual shared paths discovered in complete file indices. Shared code/declarations and debt text are assessed separately. Retained references remain identified as retained.

Shared code and declarations

Refreshed non-debt shared-source scopes for search

Target #11621 remains 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7. Five candidate heads below moved after the earlier source package; that package and its tests/review pins stay historical. Full primary indexes at #9688/#12598 now contain500 changed files each, and their actual shared paths are broader than the captured bot rows. Only the target-relevant source/header/test paths were examined; hundreds of other paths were not reviewed. All libc.md work remains in the separate debt follow-up.

Candidate / exact reviewed head Complete relevant non-debt patch Source preservation action
#11421 47912395554bf7eb9d9245149172247681158149 Api.hpp +1/-0,1hunk; unchanged evidence reused Keep the distinct _Syserror_map_search declaration alongside lfind/lsearch signatures; no linear-search implementation is supplied by this declaration.
#12597 1768c1821b2921745f051fb97b999bb63b97f38f FileAndHeap.cpp +16/-4,1hunk The added/deleted stream-handler statements match the earlier pin, but context moved. The newly added SonyInvokeConstraintHandler calls are confined to fopen_s/freopen_s error paths. Preserve them and the independent lfind/lsearch validation/loop/append contract; search does not call those wrappers or that handler. No behavior equivalence is inferred solely from matching lines.
#12688 5dce7fea277f92c9e74db908ba1a0a5e0ebbe5c6; #12700 daa3a810cbb43e399e3912df6bf3edb4221ef98c; #12965 e01288c9204944ae5befa08a514fb7d93443ac03 Per candidate Api.hpp +1/-0,1hunk; FileAndHeap.cpp +18/-0,2hunks. Refreshed12688/12700 exact patches still match the frozen12965 scope. Retain JumpBuffer.hpp plus descriptor-admission guards in append helpers and optional descriptor-close callbacks. Own search adds no call to these helpers/callbacks; do not import a fcloseall cancellation runtime gate from this shared translation unit. Full foreign native-I/O behavior remains unreviewed.
#9688 ae15d0493797e9d40b2ab2eedbf202abf14c90e3 FileAndHeap.cpp +149/-88,6hunks; newly shared Api.hpp +11/-0,3hunks Full current patch includes sorting changes plus directory-handle/factory/reopen changes. Exact directory helper bodies and new directory-reopen block already exist in owned4eff, so preserve them once; no new directory adaptation is needed for this search contract. Sorting helper/wrapper changed statements match the previous reviewed sort scope and remain separate from linear search. Preserve lfind/lsearch declarations and full-size_t overflow timing, not qsort_s's different range/handler policy. Api adds eight aligned allocation/delete declarations already present in our header and three other distinct throw/Locinfo declarations. Keep a coherent declaration set and matching type definitions, rather than copying a whole foreign Api file over our exports.
#12598 9125fed5190f6e1e14ec0ec96da721a6e4d256b6 FileAndHeap.cpp +152/-96,5hunks; newly shared Api.hpp +11/-0,3hunks Same additional directory and header preservation as9688; own source already contains those exact directory bodies/block. Retain its separate qsort_s RSIZE_MAX/constraint-handler policy without changing the linear-search checks. The common sort helper hunk does not make the two qsort_s wrappers interchangeable.

The Locinfo prototypes introduce GuestLocale::SceV2Locinfo, absent from both owned libc include trees at these target pins; any future composition retaining those foreign prototypes must carry the matching type definition. LibcException::ExceptionObject already exists in owned Api.hpp. This is a header dependency preservation detail, not a new implementation dependency or hold on standalone #11621.

This is source-only frozen-scope preservation: no clean merge/compile/runtime, arbitrary guest comparator behavior, foreign implementation correctness, author agreement or all captured42-row clearance. The retained sort rows are refreshed because their source scope actually expanded, not because prior tests were retargeted. No new runtime experiment is established by these intersections.

Shared debt documentation

Refreshed pinned shared libc debt scopes for #11621

Target 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7. These 17 shared-document candidate rows keep the captured membership labels: 15 new plus 2 retained search-sort references. Only the eleven moved heads listed in the publication guard were refreshed; six pinned source records are unchanged. This is not a whole-table/whole-PR clearance, and non-debt paths are covered separately.

Preserve the target's debt contract verbatim:

  • lfind and lsearch (libc) follow POSIX.1-2008 and FreeBSD 11 lsearch.c: return the first match; lsearch appends and increments *nelp on a miss. The console exports and behavior are unverified. A null nelp always throws std::invalid_argument. lfind returns null for *nelp == 0 before checking unused arguments. For nonempty lfind and all lsearch calls, null base, key or compare, or zero size, throw std::invalid_argument. A span past SIZE_MAX throws std::overflow_error before comparator calls or element access. On an lsearch miss, an append past SIZE_MAX throws after the scan and before copying or incrementing *nelp.

Additional current shared-debt content (the affected candidate numbers are explicit):

For search, set A's bsearch_s zero-stride acceptance is a separate documented API contract; do not overwrite lfind/lsearch's zero-size validation or overflow timing with it. These are documentation distinctions, not a fresh candidate-code audit.

Candidate / pinned head Membership; current complete debt +/- (hunks) Shared-note preservation
#9340 3f2fa3b280504410e7ff6ed94dfd435992f1d92c NEW; +1/-1 (1) Replaces the generic scanf-family note with Linux UTF-8 decoding into one/two UTF-16 units, surrogate pairs, character widths versus _s unit sizes and unsized-%lc non-BMP refusal; retain Windows host delegation and unverified console-locale caveat. Keep the target note above.
#9688 ae15d0493797e9d40b2ab2eedbf202abf14c90e3 RETAINED; source refreshed; +16/-9 (8) Retained sort membership; its previously reviewed sort-specific note remains, while current shared debt also carries set A. The new bsearch_s zero-stride note must not replace our lfind/lsearch zero-size/overflow qualifications. Also preserve set A. Keep the target note above.
#10226 20e94cc49e05144f86b1f1b2a1776c5657720eb8 NEW; +35/-17 (12) Updates the atanhf/log1pf helper/fallback description and adds log1pf, expf, erff/erfcf notes; preserve host invalid/nonfinite fallbacks, errno rules, untested FP exceptions, FMA-copy differences and unverified system-library assumptions. Also preserve set A/B. Keep the target note above.
#10229 8bb1886d3ab535c1ac45c0c4409593f55fd8718c NEW; +34/-16 (12) Adds tanhf, expm1f and atan/atan2 notes with Windows-host/FreeBSD evidence and FP/FMA limits. Wording conflict: its tanhf bullet says exported expm1f is still host, while its new expm1f bullet describes the shared msun port; reconcile the text without deciding production behavior here. Also preserve set A/B. Keep the target note above.
#10247 476bb9f96cb5f66b7bfba9de65143f5d2568d24c NEW; +32/-16 (12) Adds fdlibm log10/k_log provenance, signed-domain errno and signed-zero distinctions, sampling/FP-exception limits and title-FMA differences. Keep those qualifiers; if composed with10317, retain one reconciled log10 note rather than duplicate it. Also preserve set A/B. Keep the target note above.
#10317 edceab45c77be9c8d66bef00a6ff15caa2844838 NEW; +33/-16 (12) Adds log10 and log2/k_log notes with host sampling, NaN/errno/zero semantics, FP-exception limits and FMA differences; preserve its additional log2 note when reconciling the overlapping log10 addition. Also preserve set A/B. Keep the target note above.
#11724 6447ec7dd2c8f92cb4a6c4391cd3477f27a088e0 NEW; +2/-2 (2) Updates the two scanf-family/secure-stream notes for Linux wide stream scanning and first-unconsumed-character position. Retain width/unit/platform qualifications and the explicit absence of PS5 stream-form measurements. Keep the target note above.
#12292 d0d0787413df112c1dc1e30d2a9ba95cccd38cd0 NEW; +1/-0 (1) Adds the wide-stream null-pointer EINVAL/-1/null defensive gap versus faults reported from PPSA07923 bundled libc. Preserve the actual title-module provenance; do not convert the note wording into a new hardware-console verification claim. Keep the target note above.
#12468 abe5a9d8036e7174a7c7664cde8e4c2f5a5ac3c4 NEW; +2/-2 (2) Current-primary bytewise wide-field/scanf_s notes keep byte widths/scansets and EILSEQ/failure behavior, three bundled-library references, failed-field stream position unmeasured and stream forms not measured on PS5; the edited lines match the prior pinned patch at the new head. Keep the target note above.
#12514 cb8b5a67e7613d42e6b2b666974960bb587e938d NEW; +1/-1 (1) Replaces floating-scan errno note with Windows/Linux narrow differences, wide long-double decimal-only ERANGE conditions, quiet NaNs and ten-byte %Lf writes leaving the other six bytes untouched; retain the two bundled-library references. Keep the target note above.
#12597 1768c1821b2921745f051fb97b999bb63b97f38f NEW; +2/-2 (2) Updates fopen_s/freopen_s null-argument constraint-handler texts, EINVAL/result handling and ENOTSUP mode-only reopen qualification; retain title-bundled provenance and unverified console return/open-path clauses. Keep the target note above.
#12598 9125fed5190f6e1e14ec0ec96da721a6e4d256b6 RETAINED; source refreshed; +16/-9 (8) Retained sort membership; its previously reviewed sort-specific note remains, while current shared debt also carries set A. The new bsearch_s zero-stride note must not replace our lfind/lsearch zero-size/overflow qualifications. Also preserve set A. Keep the target note above.
#12605 45a7c8a8a22fb822e8830d3df77a864cfb356cd5 NEW; +8/-8 (1) Keep eight vector min/max helper notes with their existing NIDs, invalid_argument-versus-recorded firmware13.00 invalid-range fault distinction and separate nonempty bundled-libc/host provenance. Keep the target note above.
#12659 58fddd82c67ac084cb2d8ca6a3aff862910e7daf NEW; +1/-0 (1) Keep the added scaled-floating-NaN note: non-C locales, other SDKs and console execution unverified; PPSA03766/PPSA07923 references were run in Linux host processes. Keep the target note above.
#12688 5dce7fea277f92c9e74db908ba1a0a5e0ebbe5c6 NEW; +1/-1 (1) Append only the setjmp/longjmp context-identity-at92 I/O-lifetime implementation metadata to the existing signal-mask72/flag88 note; preserve console-unverified qualification. The same scoped paragraph edit is shared with12700/12965; the #12965 raw patch differs only in its hunk offset (27 to 28), with identical context and added/deleted text. Whole-file blobs can differ with inherited context. Keep the target note above.
#12700 daa3a810cbb43e399e3912df6bf3edb4221ef98c NEW; +1/-1 (1) Same setjmp/longjmp paragraph edit as12688/12965 (the #12965 raw patch has an offset-only hunk change) at this separately pinned head; preserve context identity92 as console-unverified implementation metadata, without inferring cancellation/runtime composition. Keep the target note above.
#12965 e01288c9204944ae5befa08a514fb7d93443ac03 NEW; +1/-1 (1) Same setjmp/longjmp paragraph edit as12688/12700; the raw hunk start moved from 27 to 28 while all context and added/deleted text remained identical at this separately pinned head; preserve context identity92 and the unverified-console limitation, not a new search/mode contract. Keep the target note above.

The expm1f wording conflict was rechecked at #10229 8bb1886d3ab535c1ac45c0c4409593f55fd8718c and remains: its tanhf note says exported expm1f is host while its expm1f note describes the shared msun port. Reconcile documentation without selecting production behavior here. The alternative scanf/qsort paragraphs, overlapping log10 additions and related setjmp notes require coherent wording if later composed; no merge order or implementation dependency is inferred.

All source identities use raw Git bytes with explicit UTF-8 decoding. Eleven heads and bases stayed stable across their bounded reads; four omitted primary patches were reconstructed from exact merge-base/head raw blobs and match complete pull-file counts. Existing runtime/console/reviewer evidence retains its original pins. No combined build, runtime, same-export, console/firmware validation, author consent, dependency or readiness conclusion follows from this shared-document review. No tests/code/cache/refs/public/central state were changed.

These are pinned shared-source preservation findings only. Existing runtime evidence keeps its tested commits and platforms. No combined build/runtime, console measurement, whole-table clearance, author consent or new implementation dependency follows from sharing these files; unshared foreign implementations are outside this note. Other retained-head and review/CI obligations remain separate.

AI-assisted: yes (Codex).


Scoped libc API preservation follow-up — #11621

Source-only review against owned 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7. This covers only the Api.hpp intersections listed below, at the frozen candidate pins; it neither retargets historical test evidence nor approves the other PRs in full.

Preserve exactly: void* APS5_VABI lfind_nid_postfix(const void* key, const void* base, size_t* count, size_t size, int (APS5_VABI *compare)(const void*, const void*));; void* APS5_VABI lsearch_nid_postfix(const void* key, void* base, size_t* count, size_t size, int (APS5_VABI *compare)(const void*, const void*));. Keep their existing symbol/NID bindings unchanged.

Candidate pin Scoped declaration action
#10989 74ce435fab44e28eb7a6c7ab67e35077d4c0b92f Keep the five filesystem pointer/error/result declarations and both explicit void() error declarations as written; no arguments or behavior inferred from mangled names.
#12586 6b3ffd47d159020e9e15f80394fdb643f442c9b3 Retain the distinct timingsafe_bcmp declaration once with const void* inputs and size_t length; retain the neighboring timingsafe_memcmp declaration.
#12920 b72b61741b9d64eabe1eb407be72defde98658c8 Keep signed int64 results, char**/size_t* outputs and guest FileStream* for getdelim/getline; do not replace FileStream with host FILE.

Apply declarations as scoped edits while preserving our own declarations; copying an older complete header could discard them. This does not establish implementation dependencies, agreed merge order, source compatibility of uninspected files, a successful merge/build, or runtime/console behavior. Other table paths and outstanding integration obligations remain separate.

AI-assisted (Claude Code).


Bounded libc debt-source supplement for #11621

Target source 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7; counterpart pins below are from the frozen 2026-10-30 05:42 UTC metadata map. This reviews only complete selected docs/dev/debt/libc.md patches: 12 candidate/path scopes (27 added, 5 deleted lines; 18 hunks). No implementation/export correctness, combined build/runtime, landing order or whole-table clearance is claimed. Historical test and review pins remain unchanged.

Keep lfind/lsearch POSIX/FreeBSD first-match and append-on-miss semantics; the console/export uncertainty, null/zero validation, before-access span overflow and after-scan append overflow remain as recorded.

The selected added/deleted debt paragraphs concern the following separate subjects; none replaces this target's own debt paragraph. During composition preserve both, and resolve overlapping foreign replacement paragraphs against the actual implementation rather than restoring stale text from hunk context.

Scoped counterparts at examined head Preservation/action
#9867 56b82ac96e61, #10113 81fa0ec111f4, #10222 de5fd246210f, #10349 71a6a726c99b, #12053 2d2c5d945357 Math and floating environment: Keep each numerical helper entry and its exact provenance: host execution of a bundled library is not console execution; FMA/SDK, rounding, DAZ/FTZ, sampled inputs and unmasked-exception limits stay attached to the specific helper. Reconcile overlapping replacement paragraphs against the actual composed implementation rather than letting a context block restore stale host/port wording.
#8965 65c7c4abe424 Formatting, scanning and secure conversions: Preserve separate narrow/wide, secure/plain and string/stream distinctions, size/error/constraint-handler policies and module-specific measurements. Conflicting handler descriptions and buffer-capacity rules across these independent patches need implementation-matched wording during any composition; this review does not choose one foreign implementation.
#12586 6b3ffd47d159 Buffer comparison and provenance: Preserve the recorded FreeBSD 11.4 timingsafe_bcmp.c source, ISC / Copyright (c) 2010 Damien Miller attribution, 0-if-identical/1-on-difference result convention and content-independence requirement. This review did not measure constant-time execution or approve the foreign implementation; the target's own function contract remains separate, with no new dependency inferred.
#12920 b72b61741b9d Streams and host diagnostics: Keep per-operation stream-lock, buffer/error, descriptor and platform caveats separate from this target's search/mode/sort contract; prose for getline or diagnostics does not qualify either implementation.
#11661 1358bef8f5c8, #11689 7f992f4931a6, #11698 998fd58bf95d Runtime, signals and thread lifetime: Preserve GS registration/unload, signal-buffer, platform and unsupported-path caveats. These runtime notes do not change the target's search/mode/sort debt or establish a new interface dependency.
#10989 74ce435fab44 Filesystem, parsing and licence provenance: Preserve filesystem stubs and source/layout limits, getsubopt state handling and required upstream licence provenance. A debt-only note neither implements an export nor waives code conventions.

Specific source distinctions:

This is AI-assisted source/documentation review. Shared prose supplies no new prerequisite, author consent or runtime qualification. Existing source/interface, CI and explicit dependency obligations remain separate.


Main refresh at e4b645a6f531

Head e4b645a6f5316e9aff461654f7f5dcb9b43000c9, tree 45ac9db4e287db5761749db5cbaa23491e11f121, ordinarily merges 0b349fa4c140634267345d7d43ee18cb02de48b8 with main c0fb4a6aad1012b7e2abecaf2949e3d26c0e525d, observed at 2026-10-30 20:15:30 UTC; published 4eff863bc8d0a6d6b2388cd4083bb9c5636f62a7 remains an ancestor. This is the documented main baseline for this refresh; later remote-main advances are not certified. The four owned contribution files and their additions remain unchanged. Earlier evidence below keeps its original pins.

This new head has source-equivalence evidence: all 82 direct compiled libc/search/nid_patcher source inputs match tested 0b349fa4c140634267345d7d43ee18cb02de48b8, and the libc, NID and third-party source trees match. This is not a new-head binary or test pass. Runtime evidence stays at that exact 0b349fa4 head: Windows/WinLibs GCC 15.2.0 r7 and WSL Ubuntu 22.04/GCC 11.4, Release, focused build and ctest -R '^(guest_search|public_headers)$' -V -j1 --repeat until-fail:3 --timeout 30 --no-tests=error passed 12 selected executions across both OS = 6 native guest runs + 6 audit-only header runs, with no failures/skips. No fresh global-header audit at e4b645a6 is claimed.

The #11621-before-#9935-before-#12574 order, other scoped/shared-file qualifications, future combined validation, reviewer acceptance and actual upstream landing remain separate. The historical approval at 921acc6 is not approval of this new head.

The audit-only case retains its generated 90-second timeout; the 64 header compile batches are excluded. Fresh hosted CI at the new head is pending after push. No new console, GPU, title, macOS, whole-product or full-suite result is claimed.

AI-assisted (Codex).

@orezraey

Copy link
Copy Markdown
Contributor

Confirmed: #11621 lands first. #9087, #9935 and #10270 already list it in Depends on; after it merges I will merge main into each, keep the lfind/lsearch paragraph beside their debt edits, and rerun the libc tests.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed build labels Nov 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@B-Howell

B-Howell commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

CI at eb364c8 (the main refresh above): 16 jobs pass, including all macOS register-context, relinker and write-watch jobs. The windows job was cancelled by its 45-minute timeout-minutes while still compiling (target 515 of 800, before any test ran). The same job finished in 17 minutes at the previous head, and other PRs' windows jobs in the same hour took 5 to 30 minutes, so this looks like a slow runner rather than this change. A maintainer rerun of that job should give the Windows CTest result for this head; I don't have rerun permission.

@B-Howell

B-Howell commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Linux check for this head, since PR CI skips the Linux test jobs: guest_search passes at eb364c8 on Ubuntu 22.04 with GCC 11.4 (Release, BUILD_TESTING=ON, built per docs/dev/BUILD.md). It also passes on the main this head merges (88e804b). The build log shows this PR's sources were recompiled before the run. Only this focused test was built and run; this is not a full-suite result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@oneandonlydean
oneandonlydean merged commit 7d41521 into boykopovar:main Nov 4, 2026
20 checks passed
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.

4 participants