Skip to content

Stdlib: AOT crc32() NestedJIT-safe bit-by-bit helper (#27077) - #27966

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-27077-crc32-aot
Aug 6, 2026
Merged

Stdlib: AOT crc32() NestedJIT-safe bit-by-bit helper (#27077)#27966
PurHur merged 1 commit into
masterfrom
agent/stdlib-27077-crc32-aot

Conversation

@PurHur

@PurHur PurHur commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Make Crc32JitHelper NestedJIT-safe (inline CRC32B/CRC32C bit-by-bit + Bin2hex-style byteOrd) so thin AOT no longer stubs VmCrc32 → 0 / wrong CRC.
  • Refresh committed prelinked/helper-runtime/.../Crc32JitHelper unit; drop AotTest crc32c skip + Crc32c AOT skip comment.
  • Repro: test/repro/issue_27077_crc32_aot.php.

php-src: ext/standard/crc32.c, ext/standard/hash_crc32.c

Closes #27077

Test plan

  • php bin/vm.php / jit.php / AOT crc32('php-compiler')4282364586 (repeat 10)
  • PHP_COMPILER_HELPER_RUNTIME_O=0 and default helper-cache path both print 4282364586
  • vendor/bin/phpunit test/unit/Crc32BuiltinTest.php → OK (incl. AOT)
  • vendor/bin/phpunit test/unit/Crc32RuntimeShrinkTest.php → OK
  • vendor/bin/phpunit --filter 'data set "crc32"' test/aot/AotTest.php → OK
  • php script/bootstrap-inventory.php --check → OK 7078/7078
  • make bootstrap-selfhost-vm-driver-execute-probe → OK
  • Not covered: north-star5-verify --strict; master already red on north-star5-fast (gen-0 manifest/driver mismatch Self-host M5: bootstrap-inventory argv driver size floor — grow beyond 451KB stub #8713). crc32_type_error AOT exit 134 fails on master too (pre-existing).

Made with Cursor

Thin AOT returned 0 (then wrong CRC with table lookups) because Crc32JitHelper
called VmCrc32 — NestedJIT stubs cross-class calls. Inline CRC32B/CRC32C with
Bin2hex-style byteOrd and refresh the helper-runtime unit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 663fc1b into master Aug 6, 2026
0 of 2 checks passed
@PurHur
PurHur deleted the agent/stdlib-27077-crc32-aot branch August 6, 2026 01:31
PurHur added a commit that referenced this pull request Aug 6, 2026
#27971)

#27966/#27968/#27969 landed past the last verified-fresh argv seed,
re-staling lowering_source_fingerprint (4f-m / #8713). Rebuild
bin-compile-aot on tip (e363d9206231…, verified-fresh) — no restamp.

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 6, 2026
#27973)

#27966/#27968/#27969 landed past the last verified-fresh argv seed,
re-staling lowering_source_fingerprint (4f-m / #8713). Rebuild
bin-compile-aot on tip (e363d9206231…, verified-fresh) — no restamp.

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.

Regression: AOT crc32() compile fails — AddrSpaceCast module verify (re-#1014, ext/standard/crc32.c)

1 participant