Repository navigation
fix(libc): retain ordinary short character scan fields - #13119
oneandonlydean merged 2 commits into
Conversation
|
Resolved in The new stream fixture fails specifically against the old public library and passes with this correction. Four focused suites pass; all11,300 comparison rows have zero field/byte regressions, with2,604 corrected comparison rows versus the documented main+#13057 baseline. Matrices overlap. The PR description now links the current source pins, outputs and negative control. The hold requested for the old head is resolved; this is a production change and needs review on the new head. @orezraey Please retain this stream failure-classification correction alongside both conversion-bookkeeping paths when integrating after the agreed landing order. Current correction evidence, SHA256 |
|
@JJenkx the
|
|
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.
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.
|
|
Manual shared-file review for the overlap bot's “could not compare” entries, at this PR's
The other14 bot-listed peers share only @peeldealer @Canzi18 @MarrasFederico Proposed order for these shared source changes: #13057, this PR, then your refreshed branches keeping both behaviors and regression sets. In #10324, placing byte orientation in the shared stream scanner (or before its dispatch) will cover the early narrow path as well. Please confirm the order or suggest a preferred integration order. The order with #9087 and its stacked follow-ups is already agreed above. AI-assisted: yes. |
|
@oneandonlydean Fixed in Added 12 direct/va-list stream cases for The description now names this head and links the correction evidence, SHA256 |
|
Resolved in The 96 new direct/va-list string/stream cases fail against old public The hold on the previous head is resolved. @oneandonlydean @orezraey Please retain this ordinary-width correction alongside the already coordinated scanner changes; the existing landing order is unchanged. No title, FPS, GPU or Windows runtime result is claimed. Correction and numeric/synthetic qualification evidence, SHA256 |
|
A Windows run with GCC 16: Windows 11 Pro 10.0.22631, i9-9900K, MSYS2 UCRT64 GCC 16.1.0, Release, this PR (
AI-assisted: yes (Claude Code) |
|
Linux run at this PR's exact head Arch Linux, kernel 7.2.9, Ryzen 9 7950X, g++ (GCC) 16.2.1 20260810, glibc 2.44, x86-64. Release,
|
|
Qualification update — 2026-10-30, repeat 2 Integrated main Resolved the narrow-character dispatch conflict with the existing measured ordinary-route/large-width logic. The generalized locking fixture keeps both secure routes and both ordinary routes; main's secure locking assertions remain. No new scanning semantics were added. Focused Linux CPU: 12 passes (guest_formatting, guest_scan_count, guest_stdio_variadic, file_streams), public_headers passed once, zero skips. MinGW syntax and conventions pass. Windows source/runtime qualification is owned by the resumed Windows worker and is separate from these Linux results. No new native SDK/title/GPU/performance claim. Evidence: immutable qualification receipts, SHA-256 Actual Windows qualification at exact refreshed public AI-assisted: yes (Codex). |
dbf670a to
0502e85
Compare
|
Current-main qualification — 2026-10-30, repeat 3 Rebased to The measured ordinary short-character, signed-width, matching/input-failure and host-q stream behavior remains. Main's new ordinary string q cutoff and character-length policy are preserved. Existing EOF/read-error errno fixtures are byte-identical to main; the measured ordinary string/stream and four-route lock fixture assertions match the previous head after normalizing temporary-file helper spelling. Main's portable temporary-file fixtures remain. No fixture assertions were weakened. Fresh Linux Release libc and test builds pass Later main Immutable source, build and test receipts, SHA-256 |
0502e85 to
9083fe9
Compare
|
Current-main qualification at Linux: guest_formatting, guest_stdio_variadic, guest_scan_count, file_streams, guest_wide_stream_scan, guest_wide_conversion, each three times: 18 passes, zero skips. Public headers, conventions, whitespace, raw production libc and test builds, and the production NID patch command pass. MinGW syntax passed for Formatting.cpp. Main gitlinks and relevant fixtures/helpers are preserved. Forcing secure scanning on the ordinary stream route fails the existing supported stream-contract assertion in No new Windows/macOS, console/reference-library, title, GPU or performance run is claimed. Earlier measurements and controls remain at their original pins. AI-assisted: yes (Codex). Immutable source, command and test evidence, SHA-256 |
|
#10324 is merged, so nothing on my side needs to come first. At |
❌ AMD GPU test: failedPR head
Failing testsThis 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.
file_streams: Subprocess aborted (also failed when re-run alone), assertion and diagnosticsUnstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (13, not counted against this PR)Passed on retry (8, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validated but not compared (65, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 749 tests)Skipped (122)ReproduceAutomated 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. |
|
Hi JJenkx, The TechLevelZero AMD run at The new loop at
The other eight inputs of the loop (including Could you make the check not depend on the host glibc? For example, assert the two inputs separately as "whatever the host glibc returns" (or leave them out of the loop with a debt note), and keep the strict matching-failure expectation for the inputs every glibc agrees on. If the console's result for |
The stream scan check expected a matching failure for "0x." and "nan(" under
"%64f %1c%n", but glibc versions disagree on those two: 2.44 fails both, while
2.39 converts "0x." to 0 and "nan(" to NaN with the "(" left for %1c. The eight
inputs every glibc agrees on keep the strict check; the two others must now give
what the host's own fscanf gives, with nothing stored when the host reports a
matching failure. The debt entry names both glibc behaviours.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@oneandonlydean thanks, you were right that this depended on the host glibc. Done in
Tested: glibc 2.44 (Arch, GCC 16.2.1, Release) AI-assisted: yes. Independent glibc reproduction, exact fixture/core probes, source proofs and raw logs, SHA-256 |
|
Windows run at exact head Setup: Windows 11 Enterprise 22621, MinGW-w64 GCC 15.2.0 UCRT (r7), Release,
AI-assisted: yes. |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (12, not counted against this PR)Validation IDs already present on main (4 IDs in 752 tests)Skipped (59)ReproduceAutomated 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. |
Keep boykopovar#13119's ordinary %n bookkeeping beside the secure contiguous one, route sscanf through ScansInProcess, and give the shared secure stream %c loop the 32-bit width rule and the destination-size clamp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Ordinary Linux character scans delegated to glibc can write a nonempty short
%cfield and then returnEOF, skipping the following%n. Route narrow character fields through the shared scanner so available bytes count as a conversion, suppressed fields advance the input, and exact-width reads leave the next field available. Stream scans retain their recursive lock throughout the operation.Preserve a reached
%nbefore later input failure, and stop unknown positional syntax as measured in both bundled references. A failed host stream conversion now keeps its own input-versus-matching classification: peeking after it has consumed an invalid numeric prefix must not turn a matching failure intoEOF. The contiguous scanner retains its existing failure classification. Ordinary narrow character fields also match the measured 32-bit signed width interpretation: zero or sign-bit-set widths default to one character after retaining the low 32 bits, rather than treating the field width as an unsigned 64-bit length.Formats containing a
qlength retain the previous host stream scanner path; their console behavior remains unverified as recorded in the existing debt entry. This prevents the narrow%crouting from rejecting previously accepted quad-length fields.Landing order agreed with the #9087 author: #13057, this PR, then #9087. #12622 and #12428 already follow #9087, including shared scanner/debt context. Owned #12397, #13012, #13025 and #13049 merged cleanly in the recorded pairwise checks after moving new fixtures out of competing insertion points.
Tested
Latest Linux qualification (2026-11-02): exact head
9083fe9a7e88c5dd26dfb721140fd535771c95f3on pinned maina4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8. Keeps main’s byte-based wide scanner, positional guard and ScansWideInProcess predicate alongside ordinary short-character routing with secure=false. The shared stream path keeps main’s orientation and error handling.6 focused groups repeated three times: 18 passes, zero skips. Public headers, conventions, whitespace, raw libc/test builds and the actual production NID-patching command passed. MinGW syntax passed for Formatting.cpp. No new Windows/macOS runtime, bundled-SDK reference, native title, GPU or performance claim; earlier evidence retains its historical pins.
Earlier pinned qualifications follow.
Linux x86_64, CPU-only Release build, bundled dependencies. Pinned upstream
08a10d225306ad102b57408e2ef7566bcfb829b2; baselinedda980dc84bd5ee955e98720c293ecb439c0c92dis that main plus #13057. Final candidate1baea53cdedba020ebd1091b550c7bcf0b92a686, libc SHA256980ee5aaa73cfda87ed2b96508ba875fcd385009f3b1302c060c00a9416c5db9.guest_formatting,guest_wide_formatting,guest_safe_errors,file_streams). All four pass after the failure-classification and quad-routing corrections.9602df2c1aeimplementation atStream scan changed a matching failure to input failure; it passes with this correction.%qd,%qi,%qu,%qo,%qxand%qXfollowed by%c%n, checking 64-bit values, consumed count, stream position and the next unread byte. They fail against the previous public45c9255296dlibrary at the intended quad-length assertion; the new candidate passes. All 11,300 existing comparison rows were rerun and are identical to the previously qualified corrected outputs.4741138ff83; the stream assertion identifies the signed-width boundary. The extended matrix finds 240 field-regressed rows per ordinary mode on that old public head and none with this correction; all previous 11,300 outputs remain unchanged. Secure width/capacity behavior is unchanged and its measured gaps are recorded in debt.%n, whole-field stream locking, and matching/input failures on ordinary and secure streams.Commands:
cmake --build <build> --parallel 2 --target libc guest_formatting_tests guest_wide_formatting_tests guest_safe_error_tests file_streams_tests;ctest --test-dir <build> -V -R '^(guest_formatting|guest_wide_formatting|guest_safe_errors|file_streams)$' --output-junit <arm>.xml.Current width-boundary correction, probes, both reference outputs, previous-output reruns and qualification, SHA256
778433297b6defa02713104a3bacab07f7bd77b4dfa36e11e25570a320148df0. Upload downloaded and hash-verified.Earlier quad-routing correction and qualification, SHA256
b8ef70e5797a6dd45e721d5aaa4fc261215f8fd570adef04580e0acdb37ec4f0. Upload downloaded and hash-verified.Failure-classification correction, qualification, boundary probe/reference outputs, all rerun candidate outputs, JUnit and old-public-head negative, SHA256
1c3aa7508eb40f98fbb031424643e70602cff026baa165e6ab2d11e802909961.Original baseline/probes/reference matrices and initial negative controls, SHA256
1a50f44872ef93a247f4f227fe047124f3a828fb473111c887b37293dfd56995. Its candidate-head results are historical; the current correction and expanded results above supersede them. Both uploads were downloaded and hash-verified. Only authored synthetic evidence is attached, no reference binaries.Independent Windows validation: bunbeans2-arch reports Windows 11 Pro22631, i9-9900K, UCRT64 GCC16.1, Release, this
1baea53cdestack merged into mainf7f03daf52.file_streamsandguest_formattingpass5/5; plain main passes both3/3. Their reset-to-mainFormatting.cppcontrol fails the file-lock check5/5 while formatting still passes. That control also removes stacked #13057, so it validates the combined stack's lock behavior, not this PR's character-field changes independently. The Linux field-specific negative controls and SDK matrices above retain that narrower attribution. This is an external contributor report; no Windows agent was resumed for it. #13057 has merged; this refreshed branch integrates that main history.Qualification update — 2026-10-30, repeat 2
Integrated main
e471817c68d4e1b1e44b0ce369ed88bafe4ae8edatdbf670a5cb1afa5d9948ebfdcdb1bea4ad8de669, preserving the old public head and actual integration parente471817c68d4e1b1e44b0ce369ed88bafe4ae8ed.Resolved the narrow-character dispatch conflict with the existing measured ordinary-route/large-width logic. The generalized locking fixture keeps both secure routes and both ordinary routes; main's secure locking assertions remain. No new scanning semantics were added.
Focused Linux CPU: 12 passes (guest_formatting, guest_scan_count, guest_stdio_variadic, file_streams), public_headers passed once, zero skips. MinGW syntax and conventions pass.
Windows source/runtime qualification is owned by the resumed Windows worker and is separate from these Linux results. No new native SDK/title/GPU/performance claim.
Evidence: immutable qualification receipts, SHA-256
0e170ba60a93a8b65f4dac8050f68833249b80b5ef519f05d38340700cedeb5b(download verified).Actual Windows qualification at exact refreshed public
dbf670a5cb1afa5d9948ebfdcdb1bea4ad8de669: Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2 UCRT r7, Ninja Release, BUILD_TESTING=ON. Rebuilt patched libc and focused tests, then repeated guest_formatting, guest_scan_count, guest_stdio_variadic, file_streams three times: 12 passes, 0 skips. Windows FIFO 726e47f972f64c37a5e32a05f5a08c41, isolated source/build reused only between completed own tests. No SDK/game/GPU/performance or new reference-data claim. Evidence: https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/owned-current-windows-20261030-repeat2.tar.gz, SHA256 e423c97373758bf59239e02c138b74f35f1a45488793bc92878a4c836f94a584. AI-assisted: yes (Codex).AI-assisted: yes (Codex).
Current-main qualification — 2026-10-30, repeat 3
Rebased to
0502e85d9873f69f4ac7377cc5b8e9c7ab0a68adon tested maind2863131efb0e41c116e4197841b6a3086ce087a, using an exact lease fromdbf670a5cb1afa5d9948ebfdcdb1bea4ad8de669. The remaining series contains six authored commits in the original order. Three earlier commits became empty because main already contains the secure short-character implementation, whole-scan lock and include grouping; they were not duplicated. The old main-integration merge is incorporated through the new base.The measured ordinary short-character, signed-width, matching/input-failure and host-q stream behavior remains. Main's new ordinary string q cutoff and character-length policy are preserved. Existing EOF/read-error errno fixtures are byte-identical to main; the measured ordinary string/stream and four-route lock fixture assertions match the previous head after normalizing temporary-file helper spelling. Main's portable temporary-file fixtures remain. No fixture assertions were weakened.
Fresh Linux Release libc and test builds pass
guest_formatting,guest_wide_formatting,guest_safe_errors,file_streams,guest_scan_countandguest_stdio_variadicthree times each: 18 passes, pluspublic_headersonce, zero skips. Three MinGW production/fixture syntax checks pass. The existing test macro and command line both defineWIN32_LEAN_AND_MEAN, producing one harmless redefinition warning. Conventions, whitespace, authored-series and submodule-pointer checks pass.Later main
6b48aee5d2ea9fce6155163d78f8ce8dc84f7827leaves every topic file unchanged and has a clean merge preview; it was not executed. No fresh Windows, macOS, SDK/reference matrix, negative-control, title, GPU or performance run is claimed. Earlier 11,300-row comparisons and Windows results retain their original pins. AI-assisted: yes (Codex).Immutable source, build and test receipts, SHA-256
784c7afd95828e9d3ec65614c80683f1ed09ce1874c0fa685b3f96c48b25dba0(download verified).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)