Skip to content

AOT: lazy HashTable locale/multisort LLVM (#35904) - #35913

Merged
PurHur merged 2 commits into
masterfrom
fix/35904-hashtable-lazy-sort-abi
Aug 30, 2026
Merged

AOT: lazy HashTable locale/multisort LLVM (#35904)#35913
PurHur merged 2 commits into
masterfrom
fix/35904-hashtable-lazy-sort-abi

Conversation

@PurHur

@PurHur PurHur commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Defer ksort/asort SORT_LOCALE_STRING and array_multisort packed HashTable LLVM until first lookup so hello-world no longer NestedJITs strcoll during HashTable::implement() (ext/standard/array.c / leftover of php-in-php: lazy strcoll/strnatcmp from HashTable::implement (#35626) #35626).
  • Keep strKey natsort LLVM eager: lazy first-link during user lowering skipped the rest of {main} (empty stdout).
  • Restore builder insert around first-time memcpy/memset/memmove bodies and scope IniRuntime bridges to the ABI function so AOT smoke stays 8/8 without the old natsort warmup.

Closes #35904

php-src: ext/standard/array.c (php_array_ksort / php_natsort / php_array_multisort); ext/standard/string.c (strcoll / strnatcmp).

Test plan

  • ./script/phpunit.sh --filter 'HashTableLazySortAbi35904RuntimeShrinkTest|HashTableLazyStringCompareRuntimeShrinkTest|NatsortPackedPreserveKeys33618AotTest|AsortKsortAot27513Test' — OK (10 tests)
  • ./script/aot-smoke.sh — 8 passed, 0 failed
  • Zend / php bin/vm.php / php bin/compile.php on test/repro/issue_35904_ksort_locale_natsort_multisort.php — identical stdout

Did not run north-star5-verify --strict or full make test-harness.

Made with Cursor

PurHur and others added 2 commits August 30, 2026 13:32
Defer ksort/asort SORT_LOCALE_STRING and array_multisort packed LLVM until
first lookup so hello-world no longer NestedJITs strcoll at HashTable init.
Keep strKey natsort eager: lazy first-link skipped the rest of {main}.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep locale/packed-natural lazy on top of master's ensureMultisortPacked.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 90dd502 into master Aug 30, 2026
@PurHur
PurHur deleted the fix/35904-hashtable-lazy-sort-abi branch August 30, 2026 13:38
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.

php-in-php: lazy HashTable locale/natural/multisort LLVM — drop always-on strcoll NestedJIT (ext/standard/array.c)

1 participant