Skip to content

Skip external trait scans for absent associated item names - #380

Draft
charliermarsh wants to merge 1 commit into
archive/ohm-1.99.0-34/charlie/pin-cargo-release-28from
charlie/filter-external-trait-item-names
Draft

charliermarsh wants to merge 1 commit into
archive/ohm-1.99.0-34/charlie/pin-cargo-release-28from
charlie/filter-external-trait-item-names

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On the seven-file uv edit, this change reduced instruction counts for the complete uv library check by 0.41% and 0.45% in two opposite-order comparisons against the Ohm −28 source. Across all 14 rustc processes in the workspace check, the reductions were 0.24% and 0.23%. uv #19612

Six fresh confirmation pairs compared optimized stage-1 builds of this branch (86dcd155) and its Ohm −28 base (0b290350) on the same edit. The complete uv library used fewer instructions in all six pairs (two-sided sign test, p = 0.03125).

Check Stock median Ir PR median Ir Median paired reduction Paired range
uv library 6,780,137,638 6,751,642,133.5 0.422% 0.407%–0.440%
uv-resolver 6,351,946,740.5 6,336,576,692 0.248% 0.209%–0.260%
Five directly edited libraries 15,520,125,332 15,470,728,641 0.319% 0.307%–0.335%
All 14 rustc processes 24,321,490,893 24,260,713,133.5 0.251% 0.246%–0.268%

When resolving a method or associated item, we scan the bindings of each candidate external trait for the requested name. We now record which symbol numbers occur in each trait in a 256-bit set in the resolver's dropless arena. If a bit is clear, the trait has no matching name. If it's set, we still scan the bindings and check the namespace.

On our compiler stack, the same change reduced instructions in uv by 0.46% across eight fresh pairs (range 0.40%–0.51%). All six pre-specified confirmation pairs favored the patch (two-sided sign test, p = 0.031). uv-resolver used 0.28% fewer instructions and the full workspace check used 0.28% fewer. The number of trait lookups in uv stayed at 24,102 in both pilot pairs. Instructions in traits_in_scope fell from 69.3M to 40.7M.

We compared optimized stage-1 builds using the same Cargo. Each compiler warmed its own incremental state at f69c1b274, applied the seven-file edit at e5a0e18f8, then ran cargo +ohm check --locked --offline -j8 at the workspace root. We used Valgrind Callgrind to count executed instructions in each rustc process during the first check after the edit.

@charliermarsh
charliermarsh changed the base branch from charlie/pin-cargo-release-28 to archive/ohm-1.99.0-34/charlie/pin-cargo-release-28 November 17, 2026 07:29
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