Skip to content

Commit bf22023

Browse files
chore(beads): close bd-2g7oyh.368 (SIMD-prefilter wcsstr)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c8b2257 commit bf22023

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

.beads/issues.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@
942942
{"id":"bd-2g7oyh.365","title":"[perf] wcsrchr ABI portable-SIMD c-or-NUL reverse result","description":"Profile-backed follow-on after bd-2g7oyh.364: the public ABI wcschr path now uses portable-SIMD c-or-NUL scanning, but wcsrchr in crates/frankenlibc-abi/src/wchar_abi.rs still walks scalar one wchar_t at a time while tracking the last match. One lever: reuse the page-contained u32x8 c-or-NUL vector scan as a chunk filter for strict unbounded wcsrchr, resolving each flagged window scalar in order and preserving the last match before the first NUL; keep hardened bounded repair path scalar. Baseline via RCH ABI microbench before production edit; proof via glibc differential offsets, NUL target behavior, alignment variation, high wchar values, guard-page no-overread, ordering/tie-breaking, FP/RNG N/A, golden sha256; post RCH bench must Score>=2.0 before keeping.","status":"closed","priority":1,"issue_type":"task","assignee":"BoldFalcon","created_at":"2026-06-13T00:36:01.181914541Z","created_by":"ubuntu","updated_at":"2026-06-13T01:16:35.933014548Z","closed_at":"2026-06-13T01:16:35.932909319Z","close_reason":"KEPT: wcsrchr strict/unbounded uses portable-SIMD wide_last_before_nul_simd already present in current HEAD; closeout proof committed in fc6acad2. Baseline pre-lever RCH vmi1153651: 4096 old 2733.7ns / ABI 3503.7ns (0.78x), 65536 old 44219.7ns / ABI 51201.0ns (0.86x). Post RCH vmi1227854 focused gate: 4096 old 1319.3ns / ABI 199.0ns (6.63x), 65536 old 21039.5ns / ABI 2619.7ns (8.03x). Proof RCH conformance_diff_wcsrchr passed 3/3 with golden sha256 3fb98cbeed206dcbbf6fa27007b4ac83bc76438ae30817652b8a07a340b54f77; ordering/tie-breaking/c==0/guard-page preserved; FP/RNG N/A. Score 10.0.","source_repo":"frankenlibc","source_repo_path":"/data/projects/frankenlibc","compaction_level":0,"original_size":0,"labels":["abi","no-gaps","perf","string","wide"],"dependencies":[{"issue_id":"bd-2g7oyh.365","depends_on_id":"bd-2g7oyh","type":"parent-child","created_at":"2026-06-13T00:36:01.181914541Z","created_by":"ubuntu","metadata":"{}","thread_id":""}]}
943943
{"id":"bd-2g7oyh.366","title":"[perf] wcscmp/wcsncmp ABI: portable-SIMD wide compare replaces scalar element loop (2-2.5x self, closes glibc gap)","status":"closed","priority":1,"issue_type":"task","created_at":"2026-06-13T00:43:24.595877467Z","created_by":"ubuntu","updated_at":"2026-06-13T00:44:15.457631075Z","closed_at":"2026-06-13T00:44:15.457541896Z","close_reason":"Shipped 3176c1f9. wcscmp/wcsncmp scalar u32-element loop -> scan_wcscmp_simd (Simd<u32,8> 8-lane; equal+NUL-free 32-byte window advances 8, else element-resolve; dual-pointer page-guarded wide32_read_within_page (addr&0xFFF)<=4064; raw [u32;8] array loads). 8 lanes amortise the page-guard cost (the 2-lane u64-SWAR lost last session). Measured (rch median ns/op, equal full scan): self 2.48x@64/2.34x@256/2.53x@1024/2.03x@65536 (>=2.0 for 5/7 sizes; 16=1.66x, 4096=1.92x just under); beats glibc <=1024 + 16384 (1.19-2.28x), closes gap at large sizes (old 0.44x->new 0.86x @ 4096; portable-SIMD vs hand-AVX2 ceiling). Parity: conformance_diff_wcscmp.rs 50k+ sign-match glibc + guard-page test. Twelfth ABI string-vein win (.352-.364 + .366). NEXT: wcscasecmp (SIMD + wide case-fold); wcsrchr in progress by peer BoldFalcon.","source_repo":"frankenlibc","source_repo_path":"/data/projects/frankenlibc","compaction_level":0,"original_size":0,"dependencies":[{"issue_id":"bd-2g7oyh.366","depends_on_id":"bd-2g7oyh","type":"parent-child","created_at":"2026-06-13T00:43:24.595877467Z","created_by":"ubuntu","metadata":"{}","thread_id":""}]}
944944
{"id":"bd-2g7oyh.367","title":"[perf] wcscasecmp/wcsncasecmp ABI: portable-SIMD ASCII-folded wide compare (2.3-5.2x self, beats glibc)","status":"closed","priority":1,"issue_type":"task","created_at":"2026-06-13T00:58:34.518370157Z","created_by":"ubuntu","updated_at":"2026-06-13T00:59:15.033117838Z","closed_at":"2026-06-13T00:59:15.033029290Z","close_reason":"Shipped 8fc7d5d7. wcscasecmp/wcsncasecmp scalar abi_towlower(ASCII-only) element loop -> scan_wcscasecmp_simd (Simd<u32,8>; wide_ascii_lower_simd = simd_ge(0x41)&simd_le(0x5A) then select+0x20 — SIMD lanes independent so NO borrow guard needed unlike narrow SWAR; folded-equal+NUL-free window advances 8 else element-resolve returning towlower(a)-towlower(b) like glibc wint_t; dual-pointer page-guarded; raw [u32;8] loads). Measured (rch median ns/op, equal-mod-case): self 2.34x@16/4.34x@64/5.15x@256/4.93x@65536 (>=2.0 EVERY size); matches-beats glibc every size (1.0-2.67x). Parity: conformance_diff_wcscasecmp.rs 40k+ sign-match glibc + guard-page. Thirteenth ABI string-vein win (.352-.367 minus peer wcsrchr). NEXT: wcsrchr (peer BoldFalcon) or wcsnlen/wcsxfrm/wcsspn if scalar.","source_repo":"frankenlibc","source_repo_path":"/data/projects/frankenlibc","compaction_level":0,"original_size":0,"dependencies":[{"issue_id":"bd-2g7oyh.367","depends_on_id":"bd-2g7oyh","type":"parent-child","created_at":"2026-06-13T00:58:34.518370157Z","created_by":"ubuntu","metadata":"{}","thread_id":""}]}
945+
{"id":"bd-2g7oyh.368","title":"[perf] wcsstr ABI: SIMD first-element prefilter replaces brute-force O(n*m) (2-9x self, 5-11x vs glibc)","status":"closed","priority":1,"issue_type":"task","created_at":"2026-06-13T01:22:26.546570065Z","created_by":"ubuntu","updated_at":"2026-06-13T01:22:58.848017686Z","closed_at":"2026-06-13T01:22:58.847902358Z","close_reason":"Shipped c8b22570. wcsstr brute-force O(n*m) -> SIMD first-element prefilter (wide_find_or_nul_simd jumps to each needle[0], verify rest; unbounded path only so no over-read past clamp; bounded keeps scalar; adversarial degrades gracefully). Measured (rch median ns/op, rare-needle[0] full scan): self 2.42x@64/6.83x@256/8.90x@16384 (>=2.0 n>=64); BEATS glibc naive wcsstr 4.96-11.22x every size. Parity: conformance_diff_wcsstr.rs (curated+window-boundary+300 random vs glibc). ⚠️span family (wcsspn/wcscspn/wcspbrk) bitset lever REJECTED (slower — small-set slice.contains auto-vectorizes; fl already beats glibc ~2x); added conformance_diff_wcsspn.rs gate instead. 14th ABI string-vein win (.352-.368 minus peer wcsrchr).","source_repo":"frankenlibc","source_repo_path":"/data/projects/frankenlibc","compaction_level":0,"original_size":0,"dependencies":[{"issue_id":"bd-2g7oyh.368","depends_on_id":"bd-2g7oyh","type":"parent-child","created_at":"2026-06-13T01:22:26.546570065Z","created_by":"ubuntu","metadata":"{}","thread_id":""}]}
945946
{"id":"bd-2g7oyh.37","title":"[perf] malloc lifecycle trace prefix fast path","description":"Profile-backed allocator target after commit b67706fc. Current source is unchanged from the kept 33989f35 allocator state; fresh RCH post-commit broad profile on vmi1227854 measured malloc_free_64 as the largest clean residual broad-bench gap: FrankenLibC p50=177.986ns p95=221.535ns p99=306.625ns mean=185.595; host glibc p50=3.571ns. Focused current-source baseline from bd-2g7oyh.36 before its rejected source edit: vmi1227854 malloc_free_64 p50=166.312ns p95=199.002ns p99=546.168ns mean=175.132; host p50=4.441ns.\\n\\nCandidate lever: one safe-Rust allocator.rs lifecycle formatting lever only. lifecycle_trace_id runs for every allocator lifecycle record and still constructs the hot malloc/free/size_class_certificate prefixes by pushing TRACE_ID_PREFIX, symbol, separator, then hex. Add exact static-prefix fast paths for the hot symbols, preserving the generic fallback for all other symbols and preserving the 16-digit lowercase hex suffix.\\n\\nRequired proof: focused RCH baseline before edit; pre/post lifecycle_trace_id/golden SHA256 unchanged (hot-cycle lifecycle SHA256 01df8806e2bfd0fda041e153ec61ec4737ad2d3cb1ce22050a2e35bab1688455 plus lifecycle_trace_id test hash); isomorphism proof for record order, decision ids, trace ids, detail bytes, counters, allocation/free tie-breaking, FP/RNG N/A; RCH post-bench and confirmation if noisy; RCH allocator tests/check/clippy; touched-file rustfmt/diff-check; one lever only; close only if Score>=2.0, otherwise restore source and close rejected.","status":"closed","priority":1,"issue_type":"task","assignee":"MossyFern","created_at":"2026-06-03T10:17:32.305686833Z","created_by":"MossyFern","updated_at":"2026-06-03T10:33:45.886922492Z","closed_at":"2026-06-03T10:33:45.886834145Z","close_reason":"Rejected: static trace-prefix candidate failed the RCH real-win gate. Baseline vmi1153651 malloc_free_64 p50 368.140ns p95 416.938ns p99 528.365ns mean 373.502ns; first post p50 364.070ns p95 537.303ns p99 681.000ns mean 369.638ns; confirmation p50 398.683ns p95 2635.527ns p99 7603.309ns mean 725.463ns. Golden SHA256 unchanged 01df8806e2bfd0fda041e153ec61ec4737ad2d3cb1ce22050a2e35bab1688455; source restored, no allocator.rs change retained.","source_repo":"frankenlibc","source_repo_path":"/data/projects/frankenlibc","compaction_level":0,"original_size":0,"labels":["allocator","malloc","no-gaps","perf"],"dependencies":[{"issue_id":"bd-2g7oyh.37","depends_on_id":"bd-2g7oyh","type":"parent-child","created_at":"2026-06-03T10:17:32.305686833Z","created_by":"MossyFern","metadata":"{}","thread_id":""}]}
946947
{"id":"bd-2g7oyh.38","title":"[perf] qsort 4-byte swap specialization","description":"Profile-backed target from fresh RCH glibc_baseline_bench after f73cafd7 on worker vmi1149989: qsort_128_i32 FrankenLibC p50=2410.516ns p95=3458.206ns p99=3540.895ns mean=2559.625; host glibc p50=1988.379ns p95=2569.028ns p99=2592.369ns mean=2026.170. Malloc remains the largest absolute gap but malloc/elimination.rs is peer-dirty and active; BlackThrush owns string bd-2g7oyh.25. This is the next clean non-string profile-backed residual.\\n\\nCandidate lever: one safe-Rust stdlib/sort.rs swap micro-kernel only. Specialize swap_chunks for width==4 so qsort_128_i32 avoids the generic split_at_mut + swap_with_slice path while preserving the exact same element swap sites, compare calls, partition decisions, recursion shape, and byte results. All non-4 widths keep the existing generic path.\\n\\nAlien primitive card: fixed-width/register micro-kernel specialization for a hot inner loop, adapted from alien-graveyard micro-kernel/superoptimizer guidance. EV before measurement=(Impact 1 * Confidence 3 * Reuse 1)/(Effort 1 * Friction 1)=3. Fallback: restore source and close rejected if golden output changes or RCH qsort p50/mean/tails do not clear Score>=2.0.\\n\\nRequired proof: focused RCH qsort baseline before edit; pre/post qsort golden-output sha256 over the reverse-ish 128-i32 sorted result; isomorphism proof for compare ordering, equality tie behavior, element swap sequence, FP/RNG N/A; RCH post-bench and confirmation if noisy; RCH sort tests/check/clippy; touched-file rustfmt/diff-check; one lever only; close only if Score>=2.0, otherwise restore source and close rejected.","status":"closed","priority":1,"issue_type":"task","assignee":"MossyFern","created_at":"2026-06-03T10:40:32.920708462Z","created_by":"ubuntu","updated_at":"2026-06-03T10:55:00.102055155Z","closed_at":"2026-06-03T10:55:00.101958783Z","close_reason":"Rejected: qsort width-4 swap specialization failed the RCH real-win gate. Broad profile vmi1149989 qsort_128_i32 p50 2410.516ns p95 3458.206ns p99 3540.895ns mean 2559.625ns vs host p50 1988.379ns. Focused baseline vmi1153651 p50 7751.337ns p95 13340.911ns p99 16677.281ns mean 8563.939ns vs host p50 4541.030ns. Golden SHA256 stayed 6f1d71d33c28656abb499ebd7177b9eda2ee8d3d369d1fb3f4e131944932851a. Post vmi1227854 p50 2735.616ns mean 2743.964ns; confirmation vmi1227854 p50 2958.296ns mean 2957.595ns. No stable Score>=2.0 win; source restored, no sort.rs change retained.","source_repo":"frankenlibc","source_repo_path":"/data/projects/frankenlibc","compaction_level":0,"original_size":0,"labels":["no-gaps","perf","qsort","stdlib"],"dependencies":[{"issue_id":"bd-2g7oyh.38","depends_on_id":"bd-2g7oyh","type":"parent-child","created_at":"2026-06-03T10:40:32.920708462Z","created_by":"ubuntu","metadata":"{}","thread_id":""}]}
947948
{"id":"bd-2g7oyh.39","title":"[parity] ecvt/fcvt nan/inf sign convention divergence vs glibc","description":"Phase B differential parity hunt. glibc ecvt/fcvt embed the sign char in the returned buffer for non-finite inputs (\"-inf\"/\"-nan\") and report *sign=0, even for -nan. FrankenLibC returned bare \"inf\"/\"nan\" with *sign=1 for -inf and dropped the -nan sign. Also strverscmp verified parity-clean (0 mismatches over 200k fuzz cases vs glibc). Fixed in commit 9fd72def.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-06-03T11:34:03.870005089Z","created_by":"ubuntu","updated_at":"2026-06-03T11:34:11.783383442Z","closed_at":"2026-06-03T11:34:11.783292069Z","close_reason":"Fixed in 9fd72def (pushed main+master). Core nonfinite_cvt() emits sign-embedded \"-inf\"/\"-nan\" with is_negative=false; ABI ecvt_r/fcvt_r switched to is_sign_negative() && is_finite() so only finite negatives report sign=1. Verified vs host glibc 2.38 C probes on {nan,-nan,inf,-inf} for ecvt/fcvt/ecvt_r/fcvt_r. New pinned core unit test + ABI integration test. RCH: core 9/9, abi ecvt 4/4, core+abi clippy -D warnings clean, fmt clean. Finite-value behavior (decpt, leading-zero strip, rounded-to-zero, -0.0 sign=1) unchanged.","source_repo":"frankenlibc","source_repo_path":"/data/projects/frankenlibc","compaction_level":0,"original_size":0,"dependencies":[{"issue_id":"bd-2g7oyh.39","depends_on_id":"bd-2g7oyh","type":"parent-child","created_at":"2026-06-03T11:34:03.870005089Z","created_by":"ubuntu","metadata":"{}","thread_id":""}]}

0 commit comments

Comments
 (0)