Skip to content

Defer declaration spans during trait and well-formedness checks - #361

Open
charliermarsh wants to merge 2 commits into
charlie/ohm-26-pr360-pr328-basefrom
charlie/ohm-26-defer-obligation-spans
Open

charliermarsh wants to merge 2 commits into
charlie/ohm-26-pr360-pr328-basefrom
charlie/ohm-26-defer-obligation-spans

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On x86_64 Linux after uv #19612, the release-trained stack through this PR used 21.89% fewer instructions for the first edited library check and 21.70% fewer for the workspace check than signed Ohm -26, at the median of eight independent confirmation pairs per command. All 16 pairs saved more than 20%. uv edit

First edited check Instructions saved (range) Rustc processes
cargo check -p uv --lib 21.72–21.96% 15 → 11
cargo check from the workspace root 21.59–21.90% 18 → 14

Two descriptive pilot pairs per command are recorded separately. These stack comparisons include #360 and the #328 port in #362. In the isolated comparison against that immediate parent, matched stage1 builds used 5.88% fewer instructions in both pairs.

Moving declarations shifted the source locations of bounds even though their meaning stayed the same. Successful downstream type and borrow checks read those locations while confirming methods and proving well-formedness, so they could not reuse their previous results. We now retain the semantic predicates, their declaring item, and their original indices. A diagnostic reads the current source location when it needs it. The audit and check_malware checks both reused their results after the real edit.

Both commands used --locked --offline -j8, signed -26 Cargo, and Ohm's procedural-macro and native-tool trust. The candidate had independent release PGO and BOLT training. We count whole-process Callgrind Ir for every ordinary Cargo-selected rustc, combining disjoint groups of compilers from two restorations of the same starting state. The replay checks all 580 original streams, command lines, executable mappings, dependency inputs, products, incremental graphs, and cold public fingerprints.

The linked regressions check current diagnostic locations and invalidation after trait-bound, closure, and opaque-iterator changes. Warm and cold diagnostics agree under both trait solvers. The v10 metadata layout remains readable in both compiler directions; the private incremental format advances so older query caches are rebuilt.

We also repeated both checks with the published Ohm -26 and -27 GNU toolchains. Across two fresh pairs per command, -27 used 21.51–21.75% fewer rustc instructions for the library check and 21.44–21.52% fewer for the workspace check. Ohm -27 release

@charliermarsh
charliermarsh marked this pull request as ready for review November 6, 2026 14:35
charliermarsh added a commit to astral-experiments/ohm that referenced this pull request Nov 6, 2026
## Summary

The release-trained compiler stack used 21.89% fewer instructions across
all rustc processes in the first edited uv library check than signed Ohm
-26, at the median of eight independent confirmation pairs. Every pair
exceeded 20%.

This pins Ohm 1.99.0-27 to the compiler stack containing [macro
expansion
anchors](astral-experiments/ohm-rust#360), [the
empty impl-directory
port](astral-experiments/ohm-rust#362), and
[deferred declaration
spans](astral-experiments/ohm-rust#361). Cargo,
Clippy, rustfmt, and Wild retain their -26 pins. The manifest keeps the
existing release PGO/BOLT training and packaging path.
@charliermarsh
charliermarsh added this pull request to stack #367 November 7, 2026 19:52
@charliermarsh
charliermarsh removed this pull request from stack #367 November 8, 2026 13:07
@charliermarsh
charliermarsh added this pull request to stack #376 November 8, 2026 13:07
@charliermarsh
charliermarsh removed this pull request from stack #376 November 8, 2026 14:21
@charliermarsh
charliermarsh added this pull request to stack #377 November 8, 2026 14:21
@charliermarsh
charliermarsh removed this pull request from stack #377 November 8, 2026 17:51
@charliermarsh
charliermarsh added this pull request to stack #381 November 8, 2026 17:51
Keep predicates, declaring items and their original indices available to
method confirmation and well-formedness checks. Resolve a predicate's
current location when constructing a diagnostic or a region error.

Adapt the late-bound generics separation from 8325de5 (#138) to the
existing v10 metadata encoding. Preserve associated identifier hygiene and
look up its source span when a caller needs the location.
@charliermarsh
charliermarsh force-pushed the charlie/ohm-26-defer-obligation-spans branch from 6a6ad1c to 6c98584 Compare November 17, 2026 07:31
@charliermarsh
charliermarsh removed this pull request from stack #381 November 17, 2026 07:33
@charliermarsh
charliermarsh added this pull request to stack #426 November 17, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant