Skip to content

Trigger JIT tracing&compilation more often in tests #12250

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

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ef6db9f
Trigger JIT tracing&compilation more often, enable JIT for ASAN
danog Sep 18, 2023
4e504e1
Revert some changes
danog Sep 20, 2023
2c965c1
Fix
danog Sep 20, 2023
ca53391
Increase JIT buffer size since Psalm get dangerously close to the 16M…
danog Sep 20, 2023
88cf395
Add test for https://github.com/php/php-src/issues/11917
danog Sep 20, 2023
b3a2b3e
Remove jit_prof_threshold
danog Sep 20, 2023
a979682
Run opcache tests with JIT on windows
danog Sep 20, 2023
94714eb
Unify JIT settings and explicitly disable JIT where needed
danog Sep 20, 2023
f397961
Move new JIT test, fixup mac OS builds too
danog Sep 20, 2023
b4ac0e2
Explicitly disable JIT for ASAN builds
danog Sep 20, 2023
8c92c0e
Remove mistakenly added additional 0
danog Sep 20, 2023
8701969
Add phpseclib, psalm, phpstan nightly JIT+ASAN tests
danog Sep 20, 2023
104f03f
Change config in all other CIs
danog Sep 20, 2023
c5af745
Change config in all other CIs
danog Sep 20, 2023
c30b9b3
Fixup config
danog Sep 20, 2023
e11a67a
Improve
danog Sep 20, 2023
665e09c
Improve tests
danog Sep 21, 2023
f822a56
Parallelize
danog Sep 21, 2023
4aa113f
Remove RAM limitations
danog Sep 21, 2023
543b52b
Update
danog Sep 21, 2023
a06eea9
Fix deps
danog Sep 21, 2023
8de7066
Fix deps
danog Sep 21, 2023
1a4d450
Fixup opcache
danog Sep 21, 2023
96f7b74
Reorder
danog Sep 21, 2023
84373f0
fix
danog Sep 21, 2023
f837597
Update to upstream phpseclib
danog Sep 22, 2023
4caf2d6
Improve workflow
danog Sep 22, 2023
12281a4
Remove new tests, move to separate PR
danog Sep 22, 2023
dbd4005
Remove stray line
danog Oct 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ arm_task:
sapi/cli/php run-tests.php
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.jit_buffer_size=16M
-d opcache.jit_buffer_size=64M
-d opcache.jit=function
-P -q -x -j2
-g FAIL,BORK,LEAK,XLEAK
Expand All @@ -217,7 +217,14 @@ arm_task:
sapi/cli/php run-tests.php
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.jit_buffer_size=16M
-d opcache.jit_buffer_size=64M
-d opcache.jit_max_root_traces=1000000
-d opcache.jit_max_side_traces=1000000
-d opcache.jit_max_exit_counters=1000000
-d opcache.jit_hot_loop=1
-d opcache.jit_hot_func=1
-d opcache.jit_hot_return=1
-d opcache.jit_hot_side_exit=1
-d opcache.jit=tracing
-P -q -x -j2
-g FAIL,BORK,LEAK,XLEAK
Expand Down
13 changes: 13 additions & 0 deletions .github/actions/test-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
runTestsParameters:
default: ''
required: false
jitType:
default: 'disable'
required: false
runs:
using: composite
steps:
Expand Down Expand Up @@ -38,6 +41,16 @@ runs:
export TEST_PHP_JUNIT=junit.out.xml
export STACK_LIMIT_DEFAULTS_CHECK=1
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
-d opcache.jit=${{ inputs.jitType }} \
-d opcache.protect_memory=1 \
-d opcache.jit_buffer_size=64M \
-d opcache.jit_max_root_traces=1000000 \
-d opcache.jit_max_side_traces=1000000 \
-d opcache.jit_max_exit_counters=1000000 \
-d opcache.jit_hot_loop=1 \
-d opcache.jit_hot_func=1 \
-d opcache.jit_hot_return=1 \
-d opcache.jit_hot_side_exit=1 \
-j$(/usr/bin/nproc) \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
Expand Down
9 changes: 9 additions & 0 deletions .github/actions/test-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ runs:
export TEST_PHP_JUNIT=junit.out.xml
export STACK_LIMIT_DEFAULTS_CHECK=1
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
-d opcache.protect_memory=1 \
-d opcache.jit_buffer_size=64M \
-d opcache.jit_max_root_traces=1000000 \
-d opcache.jit_max_side_traces=1000000 \
-d opcache.jit_max_exit_counters=1000000 \
-d opcache.jit_hot_loop=1 \
-d opcache.jit_hot_func=1 \
-d opcache.jit_hot_return=1 \
-d opcache.jit_hot_side_exit=1 \
-j$(sysctl -n hw.ncpu) \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/windows/test_task.bat
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ set OPENSSL_CONF=
rem set SSLEAY_CONF=

rem prepare for OPcache
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=1000000 -d opcache.jit_max_side_traces=1000000 -d opcache.jit_max_exit_counters=1000000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1 -d opcache.jit=tracing
rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/php-src/issues/8508)
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli

Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ jobs:
uses: ./.github/actions/test-linux
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
jitType: tracing
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.jit_buffer_size=16M
- name: Test OpCache
uses: ./.github/actions/test-linux
with:
Expand All @@ -123,12 +123,11 @@ jobs:
uses: ./.github/actions/test-linux
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
jitType: function
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.jit_buffer_size=16M
-d opcache.jit=1205
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
- name: Notify Slack
Expand Down Expand Up @@ -194,11 +193,11 @@ jobs:
- name: Test Tracing JIT
uses: ./.github/actions/test-linux
with:
jitType: tracing
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.jit_buffer_size=16M
- name: Test OpCache
uses: ./.github/actions/test-linux
with:
Expand All @@ -209,12 +208,11 @@ jobs:
- name: Test Function JIT
uses: ./.github/actions/test-linux
with:
jitType: function
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.jit_buffer_size=16M
-d opcache.jit=1205
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
Expand Down Expand Up @@ -258,29 +256,25 @@ jobs:
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
jitType: tracing
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.protect_memory=1
-d opcache.jit_buffer_size=16M
- name: Test OpCache
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.protect_memory=1
- name: Test Function JIT
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
jitType: function
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.protect_memory=1
-d opcache.jit_buffer_size=16M
-d opcache.jit=1205
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
- name: Notify Slack
Expand Down Expand Up @@ -321,6 +315,7 @@ jobs:
- name: Test OpCache
uses: ./.github/actions/test-linux
with:
jitType: tracing
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
Expand Down Expand Up @@ -375,6 +370,15 @@ jobs:
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
echo opcache.jit_max_root_traces=1000000 >> /etc/php.d/opcache.ini
echo opcache.jit_max_side_traces=1000000 >> /etc/php.d/opcache.ini
echo opcache.jit_max_exit_counters=1000000 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini
echo memory_limit=-1 >> /etc/php.d/opcache.ini
php -v
- name: Test AMPHP
if: matrix.branch.ref != 'PHP-8.0'
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ jobs:
uses: ./.github/actions/test-linux
with:
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_${{ matrix.asan && 'OpCache' || 'Tracing JIT' }}
jitType: ${{ matrix.asan && 'disable' || 'tracing' }}
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
${{ !matrix.asan && '-d opcache.jit_buffer_size=16M' || '' }}
${{ matrix.asan && '--asan -x' || '' }}
- name: Verify generated files are up to date
if: ${{ !matrix.asan }}
Expand Down Expand Up @@ -160,11 +160,10 @@ jobs:
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
jitType: tracing
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.protect_memory=1
-d opcache.jit_buffer_size=16M
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
WINDOWS:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ before_script:

# Run PHPs run-tests.php
script:
- travis_wait ./travis/test.sh -d opcache.jit_buffer_size=16M -d opcache.jit=tracing
- travis_wait 60 ./travis/test.sh -d opcache.jit=tracing -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=1000000 -d opcache.jit_max_side_traces=1000000 -d opcache.jit_max_exit_counters=1000000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'

after_success:
Expand Down