-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve jit tests #12425
Improve jit tests #12425
Conversation
Ping @iluuu1994 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'd like to move phpseclib to a separate PR targetting master
, that should be uncontroversial.
Already done :) |
Ah, sorry. I got confused by the PRs ^^ |
Ping @iluuu1994 split the Psalm/jit_check changes to https://github.com/php/php-src/pull/12406/files, removing them from this PR, both PRs should be good to merge now :) |
@@ -305,6 +305,12 @@ function main(): void | |||
'opcache.jit_hot_func=1', | |||
'opcache.jit_hot_return=1', | |||
'opcache.jit_hot_side_exit=1', | |||
'opcache.jit_max_root_traces=100000', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need this? Tests are small, it's unlikely we're hitting jit_max_root_traces
. Did you verify this for any test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to use the same parameters everywhere, to avoid hitting any limit and not compiling any trace, in case the unit tests were to include some bigger integration tests in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting may disable some tests in case they set a small opcache.jit_buffer_size
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dstogov Updated the jit_buffer_size to be the same in all tests.
run-tests.php
Outdated
'opcache.jit_blacklist_root_trace=255', | ||
'opcache.jit_blacklist_side_trace=255', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand the intention to increase "blacklist" settings. This will delay tracing JIT and actually disable JIT-ing for some tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dstogov Could you clarify a bit? Looking at the logic in zend_jit_trace_is_bad_root, it seemed to me that the higher the blacklist value, the less likely it is for a given trace to be blacklisted; by increasing the value, if the same trace errors out N-2 times, but then at the N-1th time gets compiled successfully, and N is the maximum allowed value (255), this should lead to an overall increase in the number of compiled traces; am I missing anything, and if yes, mind also updating the docs to clarify it a bit? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, in some cases blacklisting of one traces may open the possibility to record and compile other traces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, ok then, reverted!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine
@dstogov Awesome! Could you or @iluuu1994 or someone else merge this then? :) |
@danog I'll have a look at your PRs in an hour or so. |
@iluuu1994 please merge this if you don't see problems |
Note that I only merged this for master. I don't think such improvements should be made on the maintenance branches. The reason I sometimes backport things for CI is just because the nightly build unfortunately mixes config files from multiple branches (nightly.yml from master, everything else from the tested branch). Some of these improvements were already fixed on master. @danog Please rebase your branches instead of merging. That makes them easier to merge. E.g. in this case I had to squash into a temporary branch so I could rebase the single commit onto master. No big deal, but would be slightly easier if its commits were linear. |
But most importantly, thanks @danog 😉 |
Sure, no problem! |
I added a patch.php checker just as a sanity check for the nightly tests, to make sure none of them fill up the opcache memory, preventing some JIT traces from being compiled: there is value in testing the edge case of filling up the opcache memory, as proved by #12366, but my intent was more to improve JIT coverage :)
Based on #12406.