Select cache values to verify by key fingerprint, not value fingerprint - #160130
Select cache values to verify by key fingerprint, not value fingerprint#160130xmakro wants to merge 1 commit into
Conversation
|
r? @cjgillot |
I'm not sure this is a goal. Having rustc-perf force fingerprinting gives an upper bound and may detect bottlenecks that we would otherwise miss. @bors try @rust-timer queue r=me if perf is green |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… r=<try> Select cache values to verify by key fingerprint, not value fingerprint
This comment has been minimized.
This comment has been minimized.
|
The motivation is a planned follow-up to #160214 that carries unchanged query cache values forward as raw bytes, without decoding them. That changes two things:
Keeping a forced-verification run as an upper bound seems fine. I just want a sampling scheme that a user-matching configuration could rely on. |
A motivation would be for a follow-up to #160214 where we carry unchanged query cache values forward as raw bytes, without decoding them. Forcing full verification makes rustc-perf decode and re-hash every carried value, which is the work carry removes, so the benchmark would show no win. In this case, it would be good if rustc-perf resembled what users are running. |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (db3d63f): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -0.2%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 489.577s -> 488.977s (-0.12%) |
|
@bors r+ |
…y-sampling, r=cjgillot Select cache values to verify by key fingerprint, not value fingerprint rustc verifies ~1/32 of values loaded from the incremental cache by re-hashing them. The subset is selected by the value fingerprint, so it changes whenever a value changes and between any two compiler builds. That makes verification failures flaky to reproduce, and it moves the re-hashing cost around between the two builds rustc-perf compares, which is why rustc-perf forces `-Zincremental-verify-ich` on every benchmarked invocation. This PR selects by the key fingerprint and the session count instead. Both are fixed for a given previous session, so re-running a failed build verifies the same nodes and a verification failure reproduces on retry. `to_smaller_hash` mixes both fingerprint halves because neither half is evenly distributed on its own: `DefPathHash` keys share the `StableCrateId`, `HirId` keys carry a sequential id. The per-session sampling rate is unchanged at 1/32, and `-Zincremental-verify-ich` is unchanged. Coverage over time improves: the subset rotates with the session count and sweeps the entire cache every 32 sessions, while under value selection a node whose value never changed kept its roll forever, so 31/32 of unchanging values were never verified on a given toolchain. Between two compiler builds the subset still differs, because key fingerprints incorporate the rustc version through `StableCrateId`. Pinning the version via `RUSTC_FORCE_RUSTC_VERSION` and `RUSTC_OVERRIDE_VERSION_STRING` makes corresponding sessions identical; session counts align because both builds run the same scenario sequence from a fresh incremental directory. That would let rustc-perf stop forcing full verification and measure the incremental configuration users actually run. Coverage across compiler releases is unchanged: the version salt reshuffles the subset each release under either scheme, and compiletest forces full verification in all incremental tests.
…y-sampling, r=cjgillot Select cache values to verify by key fingerprint, not value fingerprint rustc verifies ~1/32 of values loaded from the incremental cache by re-hashing them. The subset is selected by the value fingerprint, so it changes whenever a value changes and between any two compiler builds. That makes verification failures flaky to reproduce, and it moves the re-hashing cost around between the two builds rustc-perf compares, which is why rustc-perf forces `-Zincremental-verify-ich` on every benchmarked invocation. This PR selects by the key fingerprint and the session count instead. Both are fixed for a given previous session, so re-running a failed build verifies the same nodes and a verification failure reproduces on retry. `to_smaller_hash` mixes both fingerprint halves because neither half is evenly distributed on its own: `DefPathHash` keys share the `StableCrateId`, `HirId` keys carry a sequential id. The per-session sampling rate is unchanged at 1/32, and `-Zincremental-verify-ich` is unchanged. Coverage over time improves: the subset rotates with the session count and sweeps the entire cache every 32 sessions, while under value selection a node whose value never changed kept its roll forever, so 31/32 of unchanging values were never verified on a given toolchain. Between two compiler builds the subset still differs, because key fingerprints incorporate the rustc version through `StableCrateId`. Pinning the version via `RUSTC_FORCE_RUSTC_VERSION` and `RUSTC_OVERRIDE_VERSION_STRING` makes corresponding sessions identical; session counts align because both builds run the same scenario sequence from a fresh incremental directory. That would let rustc-perf stop forcing full verification and measure the incremental configuration users actually run. Coverage across compiler releases is unchanged: the version salt reshuffles the subset each release under either scheme, and compiletest forces full verification in all incremental tests.
…y-sampling, r=cjgillot Select cache values to verify by key fingerprint, not value fingerprint rustc verifies ~1/32 of values loaded from the incremental cache by re-hashing them. The subset is selected by the value fingerprint, so it changes whenever a value changes and between any two compiler builds. That makes verification failures flaky to reproduce, and it moves the re-hashing cost around between the two builds rustc-perf compares, which is why rustc-perf forces `-Zincremental-verify-ich` on every benchmarked invocation. This PR selects by the key fingerprint and the session count instead. Both are fixed for a given previous session, so re-running a failed build verifies the same nodes and a verification failure reproduces on retry. `to_smaller_hash` mixes both fingerprint halves because neither half is evenly distributed on its own: `DefPathHash` keys share the `StableCrateId`, `HirId` keys carry a sequential id. The per-session sampling rate is unchanged at 1/32, and `-Zincremental-verify-ich` is unchanged. Coverage over time improves: the subset rotates with the session count and sweeps the entire cache every 32 sessions, while under value selection a node whose value never changed kept its roll forever, so 31/32 of unchanging values were never verified on a given toolchain. Between two compiler builds the subset still differs, because key fingerprints incorporate the rustc version through `StableCrateId`. Pinning the version via `RUSTC_FORCE_RUSTC_VERSION` and `RUSTC_OVERRIDE_VERSION_STRING` makes corresponding sessions identical; session counts align because both builds run the same scenario sequence from a fresh incremental directory. That would let rustc-perf stop forcing full verification and measure the incremental configuration users actually run. Coverage across compiler releases is unchanged: the version salt reshuffles the subset each release under either scheme, and compiletest forces full verification in all incremental tests.
…uwer Rollup of 22 pull requests Successful merges: - #158147 (std: fix stack buffer overflow in Windows junction_point) - #159784 (Hint that memchr returns an in-bounds index) - #160130 (Select cache values to verify by key fingerprint, not value fingerprint) - #160343 (Rename `OutlivesPredicate` to `OutlivesClause`) - #160360 (Remove rustc_middle dependency on rustc_hir_pretty) - #160387 (rustc_codegen_ssa: Correctly apply the static `--jobs-backend` limit to backend parallelism) - #160422 (move mir-opt miri tests to CI logic) - #160444 (Avoid resolving path keywords outside `TypeNS`) - #160510 (Resolver: (un)tracked borrows for `CmRefCell` made safe my unsafe speculative flag) - #155424 ([blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template) - #158726 (std: move futex implementations into sys::sync::futex) - #159225 (Split IncrCompSession out of Session) - #159820 (Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`) - #160198 (Rework `smallest_range_containing` to handle duplicates) - #160362 (Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`) - #160390 (autodiff: Handle slice-tailed DSTs in type trees) - #160420 (Suggest `cast_signed()` for overflowing signed integer literals) - #160520 (Add some tests for specialization) - #160522 (fix(bootstrap): Normalize the names of proc macro dependency crates) - #160531 (docs: fix typo in AllowExprMetavar comment) - #160538 (Update expect messages in tcp.rs doc examples to follow the style guide) - #160548 (bootstrap: Register `coverage-map` and `coverage-run` aliases via a separate step)
…y-sampling, r=cjgillot Select cache values to verify by key fingerprint, not value fingerprint rustc verifies ~1/32 of values loaded from the incremental cache by re-hashing them. The subset is selected by the value fingerprint, so it changes whenever a value changes and between any two compiler builds. That makes verification failures flaky to reproduce, and it moves the re-hashing cost around between the two builds rustc-perf compares, which is why rustc-perf forces `-Zincremental-verify-ich` on every benchmarked invocation. This PR selects by the key fingerprint and the session count instead. Both are fixed for a given previous session, so re-running a failed build verifies the same nodes and a verification failure reproduces on retry. `to_smaller_hash` mixes both fingerprint halves because neither half is evenly distributed on its own: `DefPathHash` keys share the `StableCrateId`, `HirId` keys carry a sequential id. The per-session sampling rate is unchanged at 1/32, and `-Zincremental-verify-ich` is unchanged. Coverage over time improves: the subset rotates with the session count and sweeps the entire cache every 32 sessions, while under value selection a node whose value never changed kept its roll forever, so 31/32 of unchanging values were never verified on a given toolchain. Between two compiler builds the subset still differs, because key fingerprints incorporate the rustc version through `StableCrateId`. Pinning the version via `RUSTC_FORCE_RUSTC_VERSION` and `RUSTC_OVERRIDE_VERSION_STRING` makes corresponding sessions identical; session counts align because both builds run the same scenario sequence from a fresh incremental directory. That would let rustc-perf stop forcing full verification and measure the incremental configuration users actually run. Coverage across compiler releases is unchanged: the version salt reshuffles the subset each release under either scheme, and compiletest forces full verification in all incremental tests.
…uwer Rollup of 25 pull requests Successful merges: - #154585 (treat no_mangle_generic_items as hard error instead of lint warning) - #158147 (std: fix stack buffer overflow in Windows junction_point) - #160130 (Select cache values to verify by key fingerprint, not value fingerprint) - #160343 (Rename `OutlivesPredicate` to `OutlivesClause`) - #160360 (Remove rustc_middle dependency on rustc_hir_pretty) - #160387 (rustc_codegen_ssa: Correctly apply the static `--jobs-backend` limit to backend parallelism) - #160422 (move mir-opt miri tests to CI logic) - #160444 (Avoid resolving path keywords outside `TypeNS`) - #160510 (Resolver: (un)tracked borrows for `CmRefCell` made safe my unsafe speculative flag) - #155424 ([blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template) - #158726 (std: move futex implementations into sys::sync::futex) - #158762 (Emit thumb code on VEX V5) - #159225 (Split IncrCompSession out of Session) - #159820 (Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`) - #160198 (Rework `smallest_range_containing` to handle duplicates) - #160362 (Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`) - #160390 (autodiff: Handle slice-tailed DSTs in type trees) - #160420 (Suggest `cast_signed()` for overflowing signed integer literals) - #160516 (Add regression test for HRTB projection in closure) - #160520 (Add some tests for specialization) - #160522 (fix(bootstrap): Normalize the names of proc macro dependency crates) - #160523 (Add regression test for opaque type) - #160531 (docs: fix typo in AllowExprMetavar comment) - #160538 (Update expect messages in tcp.rs doc examples to follow the style guide) - #160548 (bootstrap: Register `coverage-map` and `coverage-run` aliases via a separate step)
…y-sampling, r=cjgillot Select cache values to verify by key fingerprint, not value fingerprint rustc verifies ~1/32 of values loaded from the incremental cache by re-hashing them. The subset is selected by the value fingerprint, so it changes whenever a value changes and between any two compiler builds. That makes verification failures flaky to reproduce, and it moves the re-hashing cost around between the two builds rustc-perf compares, which is why rustc-perf forces `-Zincremental-verify-ich` on every benchmarked invocation. This PR selects by the key fingerprint and the session count instead. Both are fixed for a given previous session, so re-running a failed build verifies the same nodes and a verification failure reproduces on retry. `to_smaller_hash` mixes both fingerprint halves because neither half is evenly distributed on its own: `DefPathHash` keys share the `StableCrateId`, `HirId` keys carry a sequential id. The per-session sampling rate is unchanged at 1/32, and `-Zincremental-verify-ich` is unchanged. Coverage over time improves: the subset rotates with the session count and sweeps the entire cache every 32 sessions, while under value selection a node whose value never changed kept its roll forever, so 31/32 of unchanging values were never verified on a given toolchain. Between two compiler builds the subset still differs, because key fingerprints incorporate the rustc version through `StableCrateId`. Pinning the version via `RUSTC_FORCE_RUSTC_VERSION` and `RUSTC_OVERRIDE_VERSION_STRING` makes corresponding sessions identical; session counts align because both builds run the same scenario sequence from a fresh incremental directory. That would let rustc-perf stop forcing full verification and measure the incremental configuration users actually run. Coverage across compiler releases is unchanged: the version salt reshuffles the subset each release under either scheme, and compiletest forces full verification in all incremental tests.
…uwer Rollup of 25 pull requests Successful merges: - #158147 (std: fix stack buffer overflow in Windows junction_point) - #160130 (Select cache values to verify by key fingerprint, not value fingerprint) - #160343 (Rename `OutlivesPredicate` to `OutlivesClause`) - #160360 (Remove rustc_middle dependency on rustc_hir_pretty) - #160387 (rustc_codegen_ssa: Correctly apply the static `--jobs-backend` limit to backend parallelism) - #160422 (move mir-opt miri tests to CI logic) - #160444 (Avoid resolving path keywords outside `TypeNS`) - #160510 (Resolver: (un)tracked borrows for `CmRefCell` made safe by unsafe speculative flag) - #155424 ([blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template) - #158726 (std: move futex implementations into sys::sync::futex) - #158762 (Emit thumb code on VEX V5) - #159225 (Split IncrCompSession out of Session) - #159820 (Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`) - #160198 (Rework `smallest_range_containing` to handle duplicates) - #160362 (Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`) - #160390 (autodiff: Handle slice-tailed DSTs in type trees) - #160420 (Suggest `cast_signed()` for overflowing signed integer literals) - #160501 (Add bootstrap CLI snapshot test for testing miri) - #160516 (Add regression test for HRTB projection in closure) - #160520 (Add some tests for specialization) - #160522 (fix(bootstrap): Normalize the names of proc macro dependency crates) - #160523 (Add regression test for opaque type) - #160531 (docs: fix typo in AllowExprMetavar comment) - #160538 (Update expect messages in tcp.rs doc examples to follow the style guide) - #160548 (bootstrap: Register `coverage-map` and `coverage-run` aliases via a separate step)
rustc verifies ~1/32 of values loaded from the incremental cache by re-hashing them. The subset is selected by the value fingerprint, so it changes whenever a value changes and between any two compiler builds. That makes verification failures flaky to reproduce, and it moves the re-hashing cost around between the two builds rustc-perf compares, which is why rustc-perf forces
-Zincremental-verify-ichon every benchmarked invocation.This PR selects by the key fingerprint and the session count instead. Both are fixed for a given previous session, so re-running a failed build verifies the same nodes and a verification failure reproduces on retry.
to_smaller_hashmixes both fingerprint halves because neither half is evenly distributed on its own:DefPathHashkeys share theStableCrateId,HirIdkeys carry a sequential id.The per-session sampling rate is unchanged at 1/32, and
-Zincremental-verify-ichis unchanged. Coverage over time improves: the subset rotates with the session count and sweeps the entire cache every 32 sessions, while under value selection a node whose value never changed kept its roll forever, so 31/32 of unchanging values were never verified on a given toolchain.Between two compiler builds the subset still differs, because key fingerprints incorporate the rustc version through
StableCrateId. Pinning the version viaRUSTC_FORCE_RUSTC_VERSIONandRUSTC_OVERRIDE_VERSION_STRINGmakes corresponding sessions identical; session counts align because both builds run the same scenario sequence from a fresh incremental directory. That would let rustc-perf stop forcing full verification and measure the incremental configuration users actually run.Coverage across compiler releases is unchanged: the version salt reshuffles the subset each release under either scheme, and compiletest forces full verification in all incremental tests.