Deterministic encoding of DefPathHashMap - #162910
Conversation
11ec6a0 to
417b0b5
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…try> Deterministic encoding of `DefPathHashMap`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (df2b5a2): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 3.1%, secondary 4.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 10.3%, secondary 4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 500.132s -> 496.691s (-0.69%) |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…try> Deterministic encoding of `DefPathHashMap`
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (a367041): comparison URL. Overall result: ❌ regressions - 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 countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.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: 498.333s -> 497.372s (-0.19%) |
a07e80c to
17afd99
Compare
17afd99 to
0dde918
Compare
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
@bors r+ |
|
@bors rollup=maybe |
…uwer Rollup of 7 pull requests Successful merges: - #163327 (remove `MutTy`) - #162910 (Deterministic encoding of `DefPathHashMap`) - #163009 (dont store arbitrary parsed attributes in thir) - #162683 (Use attribute parser for `#[inline()]` attribute check) - #163429 (lint on `Ident::from_str_and_span` taking a string literal) - #163431 (Allow `#[repr(simd)]` with `f16b`) - #163433 (Support also `try-jobs:` to specify custom try jobs)
Rollup merge of #162910 - aerooneqq:det-def-path-hash-map-encoding, r=petrochenkov Deterministic encoding of `DefPathHashMap` This PR splits DefPathHashMap into two parts: deterministic (`det_part`) and non-deterministic (`non_det_part`). `det_part` is used while we sure that allocation and insertion order of def ids is deterministic, at the moment of writing it happens before we start parallel checks after prefetch of `hir_crate_items` in `run_required_analysis`. Up until this point of compilation the allocation of def ids and their insertion order into `det_part` should be the same between different compilations. Next, when non-determinism starts due to parallel compilation we put all mapping between local hash and def ids into a `SortedMap` which gives us ready-to-use sorted by local hash slice of pairs to encode while encoding metadata. Note, that this PR does not solve the problem of allocation of different def indices to same code entities (meaning same local hash), this problem is solved in #162809 by remapping needed local def indices. Also note that we serialize `det_part` as a raw bytes sequence, so during remapping if we do not place all def indices that are needed to be remapped into separate container we will end up with copying `det_part`, changing some entries in it and then serialize it as a bytes sequence. With the approach in this PR we do not copy and modify `det_part`, instead we do all modifications in `non_det_part`. r? @petrochenkov
…uwer Rollup of 7 pull requests Successful merges: - rust-lang/rust#163327 (remove `MutTy`) - rust-lang/rust#162910 (Deterministic encoding of `DefPathHashMap`) - rust-lang/rust#163009 (dont store arbitrary parsed attributes in thir) - rust-lang/rust#162683 (Use attribute parser for `#[inline()]` attribute check) - rust-lang/rust#163429 (lint on `Ident::from_str_and_span` taking a string literal) - rust-lang/rust#163431 (Allow `#[repr(simd)]` with `f16b`) - rust-lang/rust#163433 (Support also `try-jobs:` to specify custom try jobs)
…nathanBrouwer Rollup of 7 pull requests Successful merges: - rust-lang#163327 (remove `MutTy`) - rust-lang#162910 (Deterministic encoding of `DefPathHashMap`) - rust-lang#163009 (dont store arbitrary parsed attributes in thir) - rust-lang#162683 (Use attribute parser for `#[inline()]` attribute check) - rust-lang#163429 (lint on `Ident::from_str_and_span` taking a string literal) - rust-lang#163431 (Allow `#[repr(simd)]` with `f16b`) - rust-lang#163433 (Support also `try-jobs:` to specify custom try jobs)
View all comments
This PR splits DefPathHashMap into two parts: deterministic (
det_part) and non-deterministic (non_det_part).det_partis used while we sure that allocation and insertion order of def ids is deterministic, at the moment of writing it happens before we start parallel checks after prefetch ofhir_crate_itemsinrun_required_analysis. Up until this point of compilation the allocation of def ids and their insertion order intodet_partshould be the same between different compilations.Next, when non-determinism starts due to parallel compilation we put all mapping between local hash and def ids into a
SortedMapwhich gives us ready-to-use sorted by local hash slice of pairs to encode while encoding metadata.Note, that this PR does not solve the problem of allocation of different def indices to same code entities (meaning same local hash), this problem is solved in #162809 by remapping needed local def indices.
Also note that we serialize
det_partas a raw bytes sequence, so during remapping if we do not place all def indices that are needed to be remapped into separate container we will end up with copyingdet_part, changing some entries in it and then serialize it as a bytes sequence. With the approach in this PR we do not copy and modifydet_part, instead we do all modifications innon_det_part.r? @petrochenkov