feat(pkg): solve all requested platforms together - #15982
Conversation
6783d45 to
bd35eab
Compare
bd35eab to
33fe18e
Compare
33fe18e to
fa8b474
Compare
fa8b474 to
ff35b1a
Compare
## Summary - Add a trace-based regression for a lock directory with exactly one requested platform. - Assert the exact SAT problem size for a fixed one-package input: two variables and two clauses. - Guard against adding cross-platform consistency encoding to the single-platform path. This is an independent test-only performance baseline for the joint-solver work in #15982. ## Tests - `nix develop -c dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-single-platform-sat-size.t` - `CI=true nix develop -c dune build @fmt @check`
## Summary - Add a portable lock-directory regression with distinct extra files attached to two versions of one package. - Constrain the solve to the common selected version and assert that its file is copied into the lock directory. - Assert that files belonging only to the rejected version are omitted. This is an independent test-only baseline for per-platform lock extraction in #15982. ## Tests - `nix develop -c dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-common-version-extra-files.t` - `CI=true nix develop -c dune build @fmt @check`
## Summary - Add a portable lock-directory regression for an unfiltered dependency alternative whose implementations are available on different platforms. - Assert that locking preserves the implementation selected for each platform. - Build the resulting lock directory on Linux and macOS to cover consumption as well as the lock summary. This snapshots the existing per-platform selection invariant before the joint-solver change in #15982. ## Tests - `nix develop -c dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-platform-alternative-selection.t` - `CI=true nix develop -c dune build @fmt @check`
ff35b1a to
bd76ef4
Compare
bd76ef4 to
d9132ec
Compare
## Summary - Add a regression documenting that existing language versions currently allow a portable lock directory to choose different versions of one package on different platforms. - Use mutually exclusive Linux and macOS availability filters to make that behavior explicit. - Establish the compatibility baseline changed by the joint solver. This test intentionally documents legacy behavior; #15982 updates its expectation to the intended all-platform failure when no common version exists. ## Tests - `nix develop -c dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-language-version-compatibility.t` - `CI=true nix develop -c dune build @fmt @check`
## Summary - Add a portable lock-directory regression for a local package whose dependency and conflict formulas contain platform filters. - Request Linux explicitly and assert that `foo.2` remains selectable there. - Guard against evaluating local-package formulas in a platform-less environment before multi-platform solving. This is an independent test-only baseline for the joint-solver work in #15982. ## Tests - `nix develop -c dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-local-platform-constraints.t` - `CI=true nix develop -c dune build @fmt @check`
## Summary - Add a portable lock-directory regression for a package that exists in the repository but is unavailable on Linux. - Assert that the solver reports `Availability condition not satisfied` for the requested Linux platform. - Guard against reconstructing rejection reasons in a platform-less environment. This is an independent test-only baseline for the joint-solver work in #15982. ## Tests - `nix develop -c dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-platform-rejection-reason.t` - `CI=true nix develop -c dune build @fmt @check`
5a6beb1 to
4530788
Compare
bd79350 to
b9a87f4
Compare
SAT solver benchmarkI benchmarked the stack against its pre-joint-solver baseline on the 10 real repositories used in the earlier LMDB benchmark: As it currently stands, the joint solver has an approximately 2× slowdown in SAT-solving time. The geometric mean of the per-project
Method: baseline The result measures time inside the SAT solver, not end-to-end lock-generation wall time. The reduced solve count is present, but the single combined solve currently costs more than the four baseline solves summed. |
Follow-up: end-to-end lock-generation timeAn important clarification to the SAT-only results above: the joint solver is faster end-to-end, despite spending more time in the timed I reran baseline
These were interleaved runs with one warmup and five measured observations per project/revision. The SAT regression is therefore real but does not translate into a user-visible lock-generation regression: the reduction in work outside the timed SAT section more than compensates for it. |
|
In a follow up change, we have the opportunity to share a lot of the traversal work that the combined solves do. This dramatically speeds up the solve times compared the cumulative solves. Therefore I don't think any of the performance differences highlighted here will be a serious issue. |
7046ca3 to
2611e1d
Compare
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Verify portable locking succeeds when every requested platform can install the dependency. Signed-off-by: Ali Caglayan <alizter@gmail.com>
Record the duplicate-result merge failure and repeated failure diagnostics before joint solving deduplicates requested platforms. Signed-off-by: Ali Caglayan <alizter@gmail.com>
Record that separate platform solves select distinct platform-specific avoid-version packages instead of one common alternative. Signed-off-by: Ali Caglayan <alizter@gmail.com>
Build one SAT universe for every requested platform instead of solving each platform independently. Enforce one version per package name across platforms while allowing different package-name alternatives, evaluate availability and local-package constraints in each platform environment, and minimize distinct avoid-version package versions. Keep the single-platform SAT encoding unchanged, preserve each selected platform package when extracting lock data, and only copy extra files for selected package versions. Signed-off-by: Ali Caglayan <alizter@gmail.com>
2611e1d to
eafbf99
Compare
Summary
Pre-feature tests
This change merges three independent draft test branches before applying the joint-solver implementation:
Review fixes
Checks
dune runtest test/blackbox-tests/test-cases/pkg/portable-lockdirsCI=true dune build @fmt @checkCloses #13647