Repository navigation
php-in-php: MathFmod NestedJIT kernel → NestedJIT-safe PHP (#27838) - #27840
Merged
Merged
Conversation
Replace libc fmod(3) NestedJIT leaf with Floor/Ceil-shaped trunc-via-(int) in FmodJitHelper; delete JitFmodKernel + phpc_fmod_kernel and refresh the committed helper-runtime unit from an honest emit. Co-authored-by: Cursor <cursoragent@cursor.com>
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
fmod(3)NestedJIT leaf with Floor/Ceil-shaped trunc-via-(int)inFmodJitHelper(no while-loops — NestedJIT miscompiles float reduction loops under thin AOT).JitFmodKernel.php+phpc_fmod_kernel.php; drop NestedJIT allowlist / Module registration /LibcExternfmod; spine requires updated.ext_standard_FmodJitHelper_php(emit → copy; no restamp).Closes #27838
C / runtime shrink
ext/standard/JitFmodKernel.phpext/standard/phpc_fmod_kernel.phpLibcExternfmod+ Context allowlist + Module registerphp-src:
ext/standard/math.c—PHP_FUNCTION(fmod)PHP:
ext/standard/FmodJitHelper.php,lib/JIT/Builtin/MathFmod.phpTest plan
vendor/bin/phpunit test/unit/FmodRuntimeShrinkTest.php— OK 5 testsvendor/bin/phpunit test/unit/FmodBuiltinTest.php— OK 4 tests (VM + AOT, incl.PHP_COMPILER_HELPER_RUNTIME_O=1)make bootstrap-selfhost-vm-driver-execute-probe— OKphp script/bootstrap-inventory.php --check— OK 7020/7020check-helper-runtime-prelink— Fmod fresh (3 unrelated ErrorReporter stale = Trust: refresh NonObject/ScalarDim/UndefinedProperty helper-runtime after ErrorReporter #27830 drift #27832)Note:
|q|≥2^53uses Floor-style NestedJIT saturation (float quotient product); normal|q|<2^53matches Zend bit-for-bit. Builtin/AOT cases are in the exact range.Made with Cursor