JIT causes non-deterministic results in Composer's SAT dependency resolver
未关闭
还没有人认领这个 Issue。
Bug
Category: JIT
Status: Needs Triage
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.1k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
克隆链接的复现程序,检出 chore/jit-bug-composer,并分别在启用和禁用 opcache.jit=tracing 的情况下运行 ./doit2.sh。比较多次运行之间 Composer SAT 解析器的结果,然后跟踪涉及的 PHP OPcache JIT 路径。当相同的输入在启用 JIT 时产生稳定且成功的解析,而不是错误冲突时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100