Skip to content

php-in-php: lazy strcoll/strnatcmp from HashTable::implement (#35626) - #35626

Merged
PurHur merged 1 commit into
masterfrom
fix/hashtable-lazy-string-compare-35626
Aug 28, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/hashtable-lazy-string-compare-35626

Conversation

@PurHur

@PurHur PurHur commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove eager StringStrcoll / StringNaturalCompare NestedJIT from HashTable::implement() — thin hello-world AOT no longer links locale/natural sort ABIs during init.
  • Call ensureStrcollAbis() / ensureNaturalCompareAbis() only from the five implementSort* methods that actually lookupFunction strcoll or strnatcmp (peer Self-host: sync gen-0 sidecar stamp after #35606/#35607 spine edits (#8703) #35614 Type::String_::implement lazy batch).
  • No new runtime/*.c — PHP JIT bridges only.

Test plan

  • ./script/phpunit.sh --filter 'HashTableLazyStringCompareRuntimeShrinkTest|HashTableCompareRuntimeShrinkTest' → OK (7 tests, 41 assertions)
  • ./script/aot-smoke.sh → 8 passed, 0 failed
  • ./script/docker-exec.sh -- bash -lc 'script/cold-build-check.sh' → ok (4s)
  • Full ci-fast.sh not run (targeted gates above sufficient for lazy-init shrink)

Made with Cursor

Defer StringStrcoll and StringNaturalCompare NestedJIT until locale/natural
sort implement* methods run, so thin hello-world AOT skips those ABIs during
init (peer #35614 Type::String_::implement lazy batch).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 511bc9f into master Aug 28, 2026
@PurHur
PurHur deleted the fix/hashtable-lazy-string-compare-35626 branch August 28, 2026 14:34
PurHur added a commit that referenced this pull request Aug 28, 2026
…#35392) (#35649)

Move StringTriggerError declare/ensure from HashTable::implement entry to
implementReadStringKeyValue only — peer #35626 strcoll lazy pattern. Scripts
that use arrays but never read missing string keys skip NestedJIT trigger_error
during init, reducing cold-build LLVM surface (#31894 / #32122 .1 mint class).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Aug 29, 2026
…35747)

HashTable::implement no longer calls ensureLibcStrtol on every full load;
numeric-string key lookup ensures the module-local strtol(3) decl only
when that path is emitted. Reduces cold-build LLVM surface for hello-world
(#31894 / #32122 .1 mint class).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant