Repository navigation
Stdlib: thin AOT krsort/arsort via HashTable LLVM (#27227) - #27863
Merged
Merged
Conversation
NestedJIT KeySort/ValueSort helpers abort under thin standalone AOT (HashTable method stubs). Restore __hashtable__sortStringKeys* and route ksort/krsort/asort/arsort through Type\HashTable LLVM like NaturalSort, avoiding unconditional HT storeback that corrupted value-boxed arrays. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
force-pushed
the
agent/stdlib-27227-aot-krsort-arsort
branch
from
August 5, 2026 18:58
e3139fd to
9faeb66
Compare
This was referenced Aug 5, 2026
Closed
3 tasks done
PurHur
added a commit
that referenced
this pull request
Aug 5, 2026
…27864) * Trust: honest gen-0 argv refresh after #27846–#27863 drift (#27860) Rebuild prelinked/bootstrap-gen0 argv driver from current tip so lowering_source_fingerprint matches live sources (no restamp). Co-authored-by: Cursor <cursoragent@cursor.com> * Trust: prune thin-AOT KeySort/ValueSort helper orphans (#27860) #27863/#27227 retired NestedJIT HELPER_PATH sites for ksort/krsort and asort/arsort in favor of HashTable LLVM; fingerprint-stale committed units made helper-runtime-prelink --strict fail release-readiness. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
krsort()/arsort()failed module verify (1-arg bridge vs 2-arg NestedJIT helpers) and NestedJITKeySortJitHelper/ValueSortJitHelperabort or corrupt arrays under thin AOT (HashTable method stubs).__hashtable__sortStringKeys*LLVM and routeksort/krsort/asort/arsortthroughType\HashTable(NaturalSort Regression: AOT natsort()/natcasesort() abort after build — VM/JIT match Zend (ext/standard/array.c) #26975 pattern). Skip unconditionalstoreHashtableInArrayVariableon value-boxed arrays (that store corrupted thin-AOT counts/keys).ext/standard/array.c—PHP_FUNCTION(krsort)/PHP_FUNCTION(arsort). VM SSOT remainsVmArray::*Copy+*JitHelperfor host unit tests.Closes #27227
Test plan
php bin/vm.php test/repro/issue_27227_aot_krsort_arsort.php→c,b,a|3,2,1/b,a,c|3,2,1php bin/jit.phpsame./phpc build -o /tmp/aot_27227.bin test/repro/issue_27227_aot_krsort_arsort.php && /tmp/aot_27227.bin(10× match)vendor/bin/phpunit --filter 'KeySortRuntimeShrinkTest|ValueSortRuntimeShrinkTest'→ OK 8 testsMade with Cursor