Skip to content

Regression: AOT sinh() returns 0 — VM/JIT match Zend (ext/standard/math.c) #27125

Description

@PurHur

Category

bug · php-src-strict · AOT · pillar 4 · sibling of closed #27018 (cosh)

Problem

sinh(1) is 1.175201… on Zend/VM/JIT, but the AOT binary prints 0 (exit 0).

Probed 2026-08-03 on master (user_release_ready: no; inventory OK 6841/6841). #27018 fixed cosh NestedJIT returning 0; sinh still wrong.

Repro Zend / VM (2026-08-03) AOT phpc build
echo round(sinh(1), 6); 1.175201 0

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc '
cat > /tmp/aot_sinh.php <<'"'"'PHP'"'"'
<?php
echo round(sinh(1), 6), "\n";
PHP
php bin/vm.php /tmp/aot_sinh.php
PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/aot_sinh /tmp/aot_sinh.php
/tmp/aot_sinh
'

Done when

  • AOT binary prints 1.175201 (matches VM/Zend for round(sinh(1), 6))
  • Small compliance or repro guard under test/compliance/ or test/repro/
  • php-src-strict; no php-compiler-strict shortcut
  • No restamp / fake green — exercise the built binary

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 3, 2026
  2. PurHur commented on Aug 3, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

    TRY_FIRST: inventory OK 6855/6855; release-readiness user_release_ready=no (north-star5-fast gen-0 mismatch); VM probe OK.

    Taking AOT sinh() returns 0 (#27125) — mirror #27047 exp/log NestedJIT→libc kernel pattern.

  3. PurHur commented on Aug 3, 2026

    @PurHur
    OwnerAuthor

    Merged

    PR: #27166 (squash 9709be8bd7)

    Fix: SinhJitHelper → phpc_sinh_kernel / libc sinh(3) + NestedJIT short-circuit (peer cosh #27005 / tanh #27126).

    Verified:

    php bin/vm.php test/repro/issue_27125_aot_sinh.php          # 1.175201
    PHP_COMPILER_HELPER_RUNTIME_O=0 ./phpc build … && /tmp/x    # 1.175201
    PHP_COMPILER_HELPER_RUNTIME_O=1 ./phpc build … && /tmp/x    # 1.175201 (cache hit)
    php script/bootstrap-inventory.php --check                  # OK 6859/6859
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions