Skip to content

php-in-php: MathFmod NestedJIT kernel → NestedJIT-safe PHP (#27838) - #27840

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-fmod-nestedjit-27838
Aug 5, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-fmod-nestedjit-27838

Conversation

@PurHur

@PurHur PurHur commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace libc fmod(3) NestedJIT leaf with Floor/Ceil-shaped trunc-via-(int) in FmodJitHelper (no while-loops — NestedJIT miscompiles float reduction loops under thin AOT).
  • Delete JitFmodKernel.php + phpc_fmod_kernel.php; drop NestedJIT allowlist / Module registration / LibcExtern fmod; spine requires updated.
  • Honest helper-runtime refresh for ext_standard_FmodJitHelper_php (emit → copy; no restamp).

Closes #27838

C / runtime shrink

Removed Lines
ext/standard/JitFmodKernel.php 31
ext/standard/phpc_fmod_kernel.php 62
LibcExtern fmod + Context allowlist + Module register ~5
Net (diffstat) −77 source / −561 overall with docs

php-src: ext/standard/math.c — PHP_FUNCTION(fmod)
PHP: ext/standard/FmodJitHelper.php, lib/JIT/Builtin/MathFmod.php

Test plan

Note: |q|≥2^53 uses Floor-style NestedJIT saturation (float quotient product); normal |q|<2^53 matches Zend bit-for-bit. Builtin/AOT cases are in the exact range.

Made with Cursor

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>
@PurHur
PurHur merged commit 2c0bf9d into master Aug 5, 2026
0 of 2 checks passed
@PurHur
PurHur deleted the agent/runtime-php-fmod-nestedjit-27838 branch August 5, 2026 17:45
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: MathFmod NestedJIT kernel → NestedJIT-safe PHP (floor/ceil #27650 shape)

1 participant