JIT causes non-deterministic results in Composer's SAT dependency resolver
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.2k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
When JIT is enabled with opcache.jit=tracing, Composer's dependency resolver (SAT solver) produces non-deterministic results. The same composer update command with identical inputs sometimes succeeds and sometimes fails with a bogus dependency conflict.
Disabling JIT makes the issue disappear completely.
git clone -b chore/jit-bug-composer https://github.com/sanmai/pipeline.git
cd pipeline
./doit2.sh
I'm looking at this error when it fails:
Running pool optimizer.
Updating dependencies
Generating rules
Resolving dependencies through SAT
Dependency resolution completed in 0.615 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires phpunit/phpunit ^11 || ^12 -> satisfiable by phpunit/phpunit[11.5.50, 12.5.8].
- phpunit/phpunit[11.5.50, 12.5.8] require staabm/side-effects-detector ^1.0.5 -> satisfiable by staabm/side-effects-detector[1.0.5].
- Conclusion: don't install staabm/side-effects-detector 1.0.5 (conflict analysis result)
Without JIT, it works like a clock.
PHP Version
PHP 8.5.2 (cli) (built: Jan 16 2026 23:13:28) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.2, Copyright (c) Zend Technologies
with Zend OPcache v8.5.2, Copyright (c), by Zend Technologies
Operating System
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked reproducer, check out chore/jit-bug-composer, and run ./doit2.sh with opcache.jit=tracing enabled and disabled. Compare the Composer SAT resolver results across repeated runs, then trace the PHP OPcache JIT path involved. Done means identical inputs produce a stable successful resolution with JIT enabled rather than a bogus conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100