Repository navigation
Add signed-zero arithmetic regression tests for GH-25744 - #25749
Draft
rafamolina1 wants to merge 1 commit into
Draft
rafamolina1 wants to merge 1 commit into
rafamolina1 wants to merge 1 commit into
Conversation
Extend the coverage accompanying php#25608 with negative operands, infinities, NaN, integer controls, reciprocal signs, and string, JSON, and serialization outputs. Exercise hot functions for JIT validation.
Author
|
This PR adds supplementary tests for #25744 and depends on the optimizer fix in #25608. The test fails on the unpatched base and passes with that fix on PHP 8.4, 8.5, 8.6, and master, with JIT disabled and with tracing/function JIT. Feel free to cherry-pick the test into #25608 if keeping the fix and coverage together is preferable. |
Contributor
|
Thanks for checking the fix on all branches. I'd rather keep #25608 with its current test. For a non-zero operand the addition and the copy give the same result, so the INF, NaN and finite cases pass with or without the fix. The JIT has no shortcut of its own for |
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.
Adding zero to a known float can incorrectly preserve negative zero when the DFA pass replaces the arithmetic operation with a copy. This PR adds supplementary regression coverage for #25744.
Depends on #25608, which provides the optimizer fix and its initial regression test. This PR contains only the additional
ext/opcache/tests/opt/gh25744.phpttest; it is a draft because the test currently fails without that fix. It can be merged after #25608 or cherry-picked into it.The test covers both operand orders for addition, positive and negative zero constants, subtraction, negative finite operands, infinities, NaN, and integer controls. It checks zero signs through reciprocals and serialization, plus observable string and JSON results after casts and rounding. Hot functions exercise JIT configurations as well.
Validation on PHP-8.4, PHP-8.5, PHP-8.6, and master:
gh17733andgh8739failures as the base.