profile
viewpoint
Michael Woerister michaelwoerister Berlin, Germany michaelwoerister.github.io

michaelwoerister/hamt-rs 147

A Persistent Map Implementation based on Hash Array Mapped Tries

aardvark-platform/aardvark.base 95

Aardvark is an open-source platform for visual computing, real-time graphics and visualization. This repository is the basis for most platform libraries and provides basic functionality such as data-structures, math and much more.

aardvark-platform/aardvark.docs 86

Simple examples combining multiple packages provided by the aardvark platform. Each platform repository comes with separate examples -- here we collect overarching examples using for example aardvark.rendering and aardvark.media.

aardvark-platform/aardvark.rendering 61

The dependency-aware, high-performance aardvark rendering engine. This repo is part of aardvark - an open-source platform for visual computing, real-time graphics and visualization.

aardvark-platform/aardvark.media 24

Serverside, functional (ELM style) front-end and UI for aardvark, an open-source platform for visual computing, real-time graphics and visualization.

aardvark-platform/aardvark.algodat 13

Advanced data-structures (e.g. spatial acceleration data-structures such as octree, kdTree), part of aardvark, an open-source platform for visual computing, real-time graphics and visualization.

aardvark-platform/fablish 4

Elm style applications in .NET for composable user interfaces

aardvark-platform/template 4

project template for aardvark projects with build script for bootstrapping new aardvark projects (including all necessary dependencies).

aardvark-community/aardvark.semantictextonforests 3

An implementation of semantic texton forests (including a .NET wrapper for libsvm written in C++/CLI).

aardvark-platform/aardvark.fake 1

Script extensions for FAKE build scripts such as native dependency injection and cabal style add-source functionality

pull request commentrust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

I updated the rustc book. I didn't find any other places that needed updating.

@bors r=nikomatsakis

michaelwoerister

comment created time in 2 months

PR closed rust-lang/rust

[experiment] Make incremental compilation respect the -Ccodegen-units flag. S-waiting-on-author

Some local testing I did last year showed that limiting the number of CGUs for incremental compilation can improve performance quite a bit for big crates. Let's look into that some more.

+12 -20

25 comments

2 changed files

michaelwoerister

pr closed time in 2 months

pull request commentrust-lang/rust

[experiment] Make incremental compilation respect the -Ccodegen-units flag.

This is properly implemented in https://github.com/rust-lang/rust/pull/70156.

michaelwoerister

comment created time in 2 months

PR closed rust-lang/rust

[Experiment] Export generic instances from libstd. S-waiting-on-author

This should resolve issue #64140. However it is unclear if there are detrimental effects. Let's test if there are performance improvements to be had.

r? @ghost

+6 -1

11 comments

1 changed file

michaelwoerister

pr closed time in 2 months

push eventmichaelwoerister/rust

Michael Woerister

commit sha 98ead3e636acf311dbc353a787be3788c12bd9e0

Update -Ccodegen-units docs wrt incr. comp. in rustc book.

view details

push time in 2 months

pull request commentrust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

@bors r-

Good catch, @ehuss! I'll look into it.

michaelwoerister

comment created time in 2 months

pull request commentrust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

I added the relnotes tag, since this might negatively affect compile times for crates that explicitly set codegen-units in their Cargo.toml as explained in https://github.com/rust-lang/compiler-team/issues/245. This is easily fixable by adjusting or removing the codegen-units setting.

michaelwoerister

comment created time in 2 months

pull request commentrust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

@bors r=nikomatsakis

michaelwoerister

comment created time in 2 months

push eventmichaelwoerister/rust

Lukas Lueg

commit sha becebf3106407b892f25807473e23d6e8f116a1e

Ammend Rc/Arc::from_raw() docs regarding unsafety Constructing an Rc/Arc is unsafe even if the wrapped `T` is never dereferenced.

view details

Lukas Lueg

commit sha b4c96a9199f13c5c1c2afa6258d2b9206c151d9f

Refine [Arc/Rc]::from_raw() docs

view details

Waffle

commit sha a8340413fe8aa29864ce05875cc63f29af305e31

Remove `finished` flag from `MapWhile`

view details

Lukas Lueg

commit sha 586c7e3907738938db7a6730fd70d7125f5925fa

Make rc::RcBox and sync::ArcInner repr(C) Future-proof these types in case rustc reorders the inner fields. As per discussion in PR #68099.

view details

Giles Cope

commit sha a113609bdf0f05a3f32ab2f19bed38bde0d7063a

keyword docs for else and inkeyword docs for else and in.

view details

Waffle

commit sha 605bc1b19b45534b0860fad4b1d44678bc8b34e9

adjuste doc of `map_while` Fix doc of `Iterator::map_while` so it would be clearer that it isn't fused.

view details

Guillaume Gomez

commit sha c57de34e8feca218c0c696b621de87c078a2a0e0

Stabilize --crate-version option in rustdoc

view details

Ralf Jung

commit sha 22ee27b266814485fe9ab7da4b539348cb994045

update backtrace crate

view details

Markus Westerlind

commit sha c6f1215d925561021eec296d9e88aa0305d0a18d

perf(dep_graph): Avoid allocating a set on when the number reads are small `reserve_and_rehash` takes up 1.4% of the runtime on the `packed-simd` benchmark which I believe is due to the number of reads are very low in many cases (see https://github.com/rust-lang/rust/pull/50565 for instance). This avoids allocating the set until we start allocating the `reads` `SmallVec` but it is possible that a lower limit might be better (not tested since the improvement will be hard to spot either way).

view details

Arkadiusz Piekarz

commit sha b90edfcc9e1c4ff547b012c41ba2d55974794a7e

Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book

view details

Jonas Schievink

commit sha 425e7e5596c0ab6555fa75292d38863280d4a3d7

Don't insert panic when generator can not return

view details

Jonas Schievink

commit sha 5ac41a1a8d28493c7aa927ae49c664b9b9dce476

Don't insert panic when generator can not unwind

view details

Markus Westerlind

commit sha 4168c25b0f8aadcfe38c8bdae7cc51c22c2f45d1

refactor: Add an alias for the SmallVec in dep_graph

view details

Jonas Schievink

commit sha 46aeef6e655a85087f82bb0d1f94a97e83009218

Poison generators when any terminator unwinds This didn't cause issues before since generator types were always considered to "need drop", leading to unwind paths (including a `Resume` block) always getting generated.

view details

Jonas Schievink

commit sha 8d9f633f4d78777487010ae119454dc9674e42ee

Change index for SwitchInt case The indices do not matter here, and this fixes an index out of bounds panic when compiling a generator that can unwind but not return.

view details

Jonas Schievink

commit sha 2cbccced0856260c6acafabecb3030465dff28c2

Add test for unnecessary panic branches

view details

Guillaume Gomez

commit sha 57f1bb15b3f0d2fdd737804c7b7821fe1b40e256

clean up E0308 explanation

view details

Guillaume Gomez

commit sha 64460a12af8786a1859279d2944fd2fc67a3a159

Update tests

view details

Jonas Schievink

commit sha cb58de81654d92074a4abdbf90400f35f6a0062f

Apply suggestions from code review Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>

view details

Matt Cooper

commit sha ec7010a1a8ae59a7538e649218665497306eb8b1

establish immutable source for RUST_CONFIGURE_ARGS

view details

push time in 2 months

pull request commentrust-lang/rustc-dev-guide

Add documentation about incr. comp. query attributes and the "projection query" pattern.

I applied the suggested changes. I don't really know what the build failures are about since they are in links that I didn't touch.

michaelwoerister

comment created time in 2 months

push eventmichaelwoerister/rustc-guide

Michael Woerister

commit sha 430fdaa76fcb664c943652df8dc56aabd784dc7f

Apply feedback.

view details

push time in 2 months

Pull request review commentrust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

 fn merge_codegen_units<'tcx>(     // the stable sort below will keep everything nice and deterministic.     codegen_units.sort_by_cached_key(|cgu| cgu.name().as_str()); +    // This map keeps track of what got merged into what.+    let mut cgu_contents: FxHashMap<Symbol, Vec<SymbolStr>> =+        codegen_units.iter().map(|cgu| (cgu.name(), vec![cgu.name().as_str()])).collect();+     // Merge the two smallest codegen units until the target size is reached.     while codegen_units.len() > target_cgu_count {         // Sort small cgus to the back         codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate()));         let mut smallest = codegen_units.pop().unwrap();         let second_smallest = codegen_units.last_mut().unwrap(); +        // Move the mono-items from `smallest` to `second_smallest`         second_smallest.modify_size_estimate(smallest.size_estimate());         for (k, v) in smallest.items_mut().drain() {             second_smallest.items_mut().insert(k, v);         }++        // Record that `second_smallest` now contains all the stuff that was in+        // `smallest` before.+        let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap();+        cgu_contents.get_mut(&second_smallest.name()).unwrap().extend(consumed_cgu_names.drain(..));+         debug!(-            "CodegenUnit {} merged in to CodegenUnit {}",+            "CodegenUnit {} merged into CodegenUnit {}",             smallest.name(),             second_smallest.name()         );     }      let cgu_name_builder = &mut CodegenUnitNameBuilder::new(tcx);-    for (index, cgu) in codegen_units.iter_mut().enumerate() {-        cgu.set_name(numbered_codegen_unit_name(cgu_name_builder, index));++    if tcx.sess.opts.incremental.is_some() {+        // If we are doing incremental compilation, we want CGU names to+        // reflect the path of the source level module they correspond to.+        // For CGUs that contain the code of multiple modules because of the+        // merging done above, we use a concatenation of the names of+        // all contained CGUs.+        let new_cgu_names: FxHashMap<Symbol, String> = cgu_contents+            .into_iter()+            // This `filter` makes sure we only update the name of CGUs that+            // were actually modified by merging.+            .filter(|(_, cgu_contents)| cgu_contents.len() > 1)+            .map(|(current_cgu_name, cgu_contents)| {+                let mut cgu_contents: Vec<&str> = cgu_contents.iter().map(|s| &s[..]).collect();++                // Sort the names, so things are deterministic and easy to+                // predict.+                cgu_contents.sort();++                (current_cgu_name, cgu_contents.join("--"))

By default the name will be replaced with a fixed-length hash of itself, so that should not be a problem.

michaelwoerister

comment created time in 2 months

create barnchmichaelwoerister/rustc-guide

branch : query-attrs

created branch time in 2 months

PR opened rust-lang/rustc-dev-guide

Update description of incremental compilation.

This PR adds a bit more information about cache promotion and how the compiler backend is integrated with incremental compilation.

+98 -27

0 comment

2 changed files

pr created time in 2 months

create barnchmichaelwoerister/rustc-guide

branch : incr-comp-updates

created branch time in 2 months

pull request commentrust-lang/rust

Clean up debugging options

@bors r+

nnethercote

comment created time in 2 months

pull request commentrust-lang/rust

Refactor object file handling

If I remember correctly "marker" bitcode embedding had something to do with iOS compatibility? https://github.com/rust-lang/rust/issues/35968 has some discussion on it; but @alexcrichton would know more about that anyway.

nnethercote

comment created time in 2 months

issue commentrust-lang/rust

Do not store LLVM bitcode in RLIBs by default

@nnethercote's original PR (linked above) has some quite compelling numbers: https://github.com/rust-lang/rust/pull/66598#issuecomment-557005098

michaelwoerister

comment created time in 2 months

issue commentrust-lang/rust

rustc compiles function that is never used

It might have to do with the reachability pass being rather conservative around methods in trait impls? https://github.com/rust-lang/rust/blob/1add455ec6f81045e7651c6225902823f5d4fbfa/src/librustc_mir/monomorphize/collector.rs#L1008

WaffleLapkin

comment created time in 2 months

Pull request review commentrust-lang/rust

Clean up debugging options

 options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,         "for every macro invocation, print its name and arguments"),     debug_macros: bool = (false, parse_bool, [TRACKED],         "emit line numbers debug info inside macros"),-    generate_arange_section: bool = (true, parse_bool, [TRACKED],-        "generate DWARF address ranges for faster lookups"),

Oh, I read the comment on parse_bool now. It seems like the behavior of parse_bool is not intentional. I'm OK with removing the kind of outdated -Z incremental-queries flags, but for -Z generate-arange-section it seems useful to enable opting out.

nnethercote

comment created time in 2 months

Pull request review commentrust-lang/rust

Clean up debugging options

 options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,         "for every macro invocation, print its name and arguments"),     debug_macros: bool = (false, parse_bool, [TRACKED],         "emit line numbers debug info inside macros"),-    generate_arange_section: bool = (true, parse_bool, [TRACKED],-        "generate DWARF address ranges for faster lookups"),

Why is this removed?

nnethercote

comment created time in 2 months

issue commentrust-lang/rust

Let custom codegen backends opt out of LTO

I think the entirety of LTO should be implemented in the specific backends. It makes no sense to me to have it in the backend interface.

bjorn3

comment created time in 2 months

pull request commentrust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

clap doesn't really regress. It's just that that crate explicitly sets its CGU count to 4 which makes incremental compilation ineffective. Removing that line from the Cargo.toml brings things back to normal. The opt build (which does not have an explicit setting for codegen-units) is unaffected.

I'd expect the rules for a cranelift backend to be rather different overall. You could certainly make it use a different default if necessary.

michaelwoerister

comment created time in 2 months

Pull request review commentrust-lang/rust

Add cryptographic hash of source files in debug info

 pub struct SourceFile {     pub normalized_pos: Vec<NormalizedPos>,     /// A hash of the filename, used for speeding up hashing in incremental compilation.     pub name_hash: u128,+    /// Cryptographic hash of on-disk bytes for debug info.+    pub src_file_checksum: Option<SourceFileChecksum>,

No, we moved away from BLAKE2 because it was unnecessarily slow and we don't need the strong guarantees it gives: https://github.com/rust-lang/rust/issues/41215

arlosi

comment created time in 2 months

pull request commentrust-lang/rust

rustc_codegen_llvm: don't generate any type debuginfo for -Cdebuginfo=1.

This looks straightforward to me now. Thanks, @eddyb!

@bors r+

eddyb

comment created time in 2 months

Pull request review commentrust-lang/rust

Add cryptographic hash of source files in debug info

 pub struct SourceFile {     pub normalized_pos: Vec<NormalizedPos>,     /// A hash of the filename, used for speeding up hashing in incremental compilation.     pub name_hash: u128,+    /// Cryptographic hash of on-disk bytes for debug info.+    pub src_file_checksum: Option<SourceFileChecksum>,

src_hash is the 128 bit version of SipHash. It would not consider that cryptographically secure (although both MD5 and SHA-1 are not much better at this point, right?)

arlosi

comment created time in 2 months

pull request commentrust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

@bors try @rust-timer queue

michaelwoerister

comment created time in 2 months

pull request commentrust-lang/rust

Build dist-android with --enable-profiler

From looking at LLVM cmake files it seems like some of the sanitizers are built with -ffreestanding but not the profiling runtime. Let's see if removing this causes any trouble.

@bors r+

rojamd

comment created time in 2 months

PR opened rust-lang/rust

Make the rustc respect the `-C codegen-units` flag in incremental mode.

This PR implements (the as of yet unapproved) major change proposal at https://github.com/rust-lang/compiler-team/issues/245. See the description there for background and rationale.

The changes are pretty straightforward and should be easy to rebase if the proposal gets accepted at some point.

r? @nikomatsakis cc @pnkfelix

+120 -25

0 comment

4 changed files

pr created time in 2 months

create barnchmichaelwoerister/rust

branch : incr-cgus

created branch time in 2 months

pull request commentrust-lang/rust

Build dist-android with --enable-profiler

This is the error it fails with:

error: failed to run custom build command for `profiler_builtins v0.0.0 (/checkout/src/libprofiler_builtins)`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/release/build/profiler_builtins-9bb15f3a7adeeb21/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("arm-linux-androideabi")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-unknown-linux-gnu")
CC_arm-linux-androideabi = Some("sccache /android/ndk/arm-14/bin/arm-linux-androideabi-clang")
CFLAGS_arm-linux-androideabi = Some("-ffunction-sections -fdata-sections -fPIC --target=arm-linux-androideabi")
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
running: "sccache" "/android/ndk/arm-14/bin/arm-linux-androideabi-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=arm-linux-androideabi" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm-linux-androideabi" "-I" "/checkout/src/llvm-project/compiler-rt/include" "-fno-builtin" "-fvisibility=hidden" "-fomit-frame-pointer" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-DCOMPILER_RT_HAS_UNAME=1" "-DCOMPILER_RT_HAS_FCNTL_LCK=1" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/arm-linux-androideabi/release/build/profiler_builtins-48aac5a25541f1f3/out/GCDAProfiling.o" "-c" "/checkout/src/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c"
exit code: 0
running: "sccache" "/android/ndk/arm-14/bin/arm-linux-androideabi-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=arm-linux-androideabi" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm-linux-androideabi" "-I" "/checkout/src/llvm-project/compiler-rt/include" "-fno-builtin" "-fvisibility=hidden" "-fomit-frame-pointer" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-DCOMPILER_RT_HAS_UNAME=1" "-DCOMPILER_RT_HAS_FCNTL_LCK=1" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/arm-linux-androideabi/release/build/profiler_builtins-48aac5a25541f1f3/out/InstrProfiling.o" "-c" "/checkout/src/llvm-project/compiler-rt/lib/profile/InstrProfiling.c"
exit code: 0
running: "sccache" "/android/ndk/arm-14/bin/arm-linux-androideabi-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=arm-linux-androideabi" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm-linux-androideabi" "-I" "/checkout/src/llvm-project/compiler-rt/include" "-fno-builtin" "-fvisibility=hidden" "-fomit-frame-pointer" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-DCOMPILER_RT_HAS_UNAME=1" "-DCOMPILER_RT_HAS_FCNTL_LCK=1" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/arm-linux-androideabi/release/build/profiler_builtins-48aac5a25541f1f3/out/InstrProfilingBuffer.o" "-c" "/checkout/src/llvm-project/compiler-rt/lib/profile/InstrProfilingBuffer.c"
exit code: 0
running: "sccache" "/android/ndk/arm-14/bin/arm-linux-androideabi-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=arm-linux-androideabi" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm-linux-androideabi" "-I" "/checkout/src/llvm-project/compiler-rt/include" "-fno-builtin" "-fvisibility=hidden" "-fomit-frame-pointer" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-DCOMPILER_RT_HAS_UNAME=1" "-DCOMPILER_RT_HAS_FCNTL_LCK=1" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/arm-linux-androideabi/release/build/profiler_builtins-48aac5a25541f1f3/out/InstrProfilingFile.o" "-c" "/checkout/src/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c"
cargo:warning=In file included from /checkout/src/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c:27:
cargo:warning=In file included from /android/ndk/arm-14/bin/../sysroot/usr/include/unistd.h:35:
cargo:warning=In file included from /android/ndk/arm-14/bin/../sysroot/usr/include/sys/select.h:36:
cargo:warning=In file included from /android/ndk/arm-14/bin/../sysroot/usr/include/signal.h:193:
cargo:warning=/android/ndk/arm-14/bin/../sysroot/usr/include/android/legacy_signal_inlines.h:71:33: error: use of undeclared identifier 'LONG_BIT'
cargo:warning=  return (int)((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
cargo:warning=                                ^
cargo:warning=/android/ndk/arm-14/bin/../sysroot/usr/include/android/legacy_signal_inlines.h:71:53: error: use of undeclared identifier 'LONG_BIT'
cargo:warning=  return (int)((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
cargo:warning=                                                    ^
cargo:warning=/android/ndk/arm-14/bin/../sysroot/usr/include/android/legacy_signal_inlines.h:82:19: error: use of undeclared identifier 'LONG_BIT'
cargo:warning=  local_set[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT);
cargo:warning=                  ^
cargo:warning=/android/ndk/arm-14/bin/../sysroot/usr/include/android/legacy_signal_inlines.h:82:46: error: use of undeclared identifier 'LONG_BIT'
cargo:warning=  local_set[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT);
cargo:warning=                                             ^
cargo:warning=/android/ndk/arm-14/bin/../sysroot/usr/include/android/legacy_signal_inlines.h:94:19: error: use of undeclared identifier 'LONG_BIT'
cargo:warning=  local_set[bit / LONG_BIT] &= ~(1UL << (bit % LONG_BIT));
cargo:warning=                  ^
cargo:warning=/android/ndk/arm-14/bin/../sysroot/usr/include/android/legacy_signal_inlines.h:94:48: error: use of undeclared identifier 'LONG_BIT'
cargo:warning=  local_set[bit / LONG_BIT] &= ~(1UL << (bit % LONG_BIT));
cargo:warning=                                               ^
cargo:warning=6 errors generated.
exit code: 1

rojamd

comment created time in 2 months

pull request commentrust-lang/rust

Build dist-android with --enable-profiler

@bors r+

rojamd

comment created time in 2 months

Pull request review commentrust-lang/rust

Avoid query type in generics

 macro_rules! define_queries_inner {         // predictable symbol name prefix for query providers. This is helpful         // for analyzing queries in profilers.         pub(super) mod __query_compute {

I think @nikomatsakis perf-focus tool might have used this. I'm OK with removing it.

cjgillot

comment created time in 3 months

issue commentrust-lang/rust

cstore_impl dependency format linkage sometimes unknown

No, #68277 didn't change anything there. It fixed the -Zshare-generics problems by going another route.

pnkfelix

comment created time in 3 months

pull request commentrust-lang/rust

Use queries for the HIR map

I'm in favor of merging this. It removes most special casing around HIR dependency tracking, making the HIR map query-based.

It would be great to add doc comments describing the new queries and that they are not supposed to be used directly. It also would be nice to squash the some of the earlier commits that contain lots of things that don't make it to the final diff.

Heads up, @rust-lang/compiler-contributors, this slightly regresses performance for some of the check builds. However, the regression is small and mostly in synthetic test cases. Debug- and opt-builds are not noticeably affected.

I'll leave it to @eddyb to give the final r+.

Zoxc

comment created time in 3 months

Pull request review commentrust-lang/rust

Use queries for the HIR map

 impl DepGraph {                             continue;                         }                     } else {+                        // FIXME: This match is just a workaround for incremental bugs and should be removed.                         match dep_dep_node.kind {-                            DepKind::Hir | DepKind::HirBody | DepKind::CrateMetadata => {+                            DepKind::hir_owner+                            | DepKind::hir_owner_items+                            | DepKind::CrateMetadata => {

Well, I'm fine with merging this if you mention #62649 in the FIXME comment above.

Zoxc

comment created time in 3 months

pull request commentrust-lang/rust

Emit 1-based column numbers in debuginfo

Thanks, @tmiasko! Looks good to me.

@bors r+

tmiasko

comment created time in 3 months

Pull request review commentrust-lang/rust

Remove the `no_force` query attribute

 trait DepNodeParams<'tcx>: fmt::Debug {     fn to_debug_str(&self, _: TyCtxt<'tcx>) -> String {         format!("{:?}", self)     }++    fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>;

Please add a comment like:

    /// This method tries to recover the query key from the given `DepNode`,
    /// something which is needed when forcing `DepNode`s during red-green 
    /// evaluation. The query system will only call this method if 
    /// `CAN_RECONSTRUCT_QUERY_KEY` is `true`.
    /// It is always valid to return `None` here, in which case incremental
    /// compilation will treat the query as having changed.
Zoxc

comment created time in 3 months

Pull request review commentrust-lang/rust

Use queries for the HIR map

 impl DepGraph {                             continue;                         }                     } else {+                        // FIXME: This match is just a workaround for incremental bugs and should be removed.                         match dep_dep_node.kind {-                            DepKind::Hir | DepKind::HirBody | DepKind::CrateMetadata => {+                            DepKind::hir_owner+                            | DepKind::hir_owner_items+                            | DepKind::CrateMetadata => {

I had a chance to test this and I think the explanation in https://github.com/rust-lang/rust/issues/62649#issuecomment-589082343 basically applies here:

  • Something::foo is a valid query key for hir_owner in rpass1 but in rpass2 it's not a valid key anymore.
  • The red-green algorithm does not detect this because RecoverKey::recover() returns Some(_) instead of None. The algorithm thus goes ahead with forcing DepNode::hir_owner(Something::foo) and ICEs.

A short-term fix for this would be to have a newtype struct HirOwnerDefId(DefId) that is a DefId with the additional invariant that it must correspond to a hir-owner. Then <HirOwnerDefId as RecoverKey>::recover() could apply the same check as done here and return None if it doesn't hold. Most uses of HirOwnerDefId should stay hidden behind the hir map wrapper, so this shouldn't be too disruptive.

Another workaround would be to diversify the DefPathData variants again so that a field and a method would not have the same DefPath anymore. Either fixes would be acceptable solutions for unblocking this PR, in my opinion.

I think one way to fix the problem at the conceptual level would be to add the invariant that RecoverKey::recover() must only return Some(_) if the recovered key is actually a valid query-key for the given query. That is, the result of RecoverKey::recover() would need to depend on the query, not just on the type of the query-key. It would then be able to do query-specific runtime checks about key validity.

Zoxc

comment created time in 3 months

more