php / php/php-src

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

Đang mở
#21,079 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Bug Category: JIT Status: Needs Triage
Ngôn ngữ chính
C
Star
40.4k
Fork
8.1k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Clone reproducer được liên kết, checkout chore/jit-bug-composer và chạy ./doit2.sh với opcache.jit=tracing được bật và tắt. So sánh kết quả của bộ phân giải SAT của Composer qua các lần chạy lặp lại, sau đó trace đường đi PHP OPcache JIT liên quan. Hoàn tất khi các đầu vào giống hệt nhau tạo ra một lần phân giải thành công ổn định với JIT được bật thay vì một xung đột giả.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
php
Lĩnh vực
compilers
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.