php / php/php-src

JIT causes non-deterministic results in Composer's SAT dependency resolver

オープン
#21,079 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Category: JIT Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
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.

Reproducer:

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされた再現コードをクローンし、chore/jit-bug-composer をチェックアウトして、opcache.jit=tracing を有効にした場合と無効にした場合の両方で ./doit2.sh を実行します。繰り返し実行した Composer SAT リゾルバーの結果を比較し、その後、関連する PHP OPcache JIT の経路をトレースします。同一の入力が、JIT を有効にした状態で偽の競合ではなく、安定した解決成功を生成すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
compilers
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。