Open
Description
Infrastructure for parallel compilation has landed in rustc, but the shared state involved has not been fully documented (in terms of what state exists, invariants, atomicity, lock ordering, etc) or assessed for removal by refactoring.
This issue tracks the PR history for parallelization infrastructure, which is being re-audited to seed an initial list of shared state to assess. The initial output of the audit is this paper doc, which will ultimately be turned into a set of individual issues.
PR List
- Add sync module to rustc_data_structures #46709
- Work towards thread safety in rustc #46779
- Add a
fatal_cycle
attribute for queries which indicates that they will cause a fatal error on query cycles #47906 - Replace Rc with Lrc for shared data #48586
- Make TransitiveRelation thread safe. Avoid locking by using get_mut in some cases #48587
- Make metadata references Send + Sync #48690
- Move PROFQ_CHAN to a Session field #48691
- Move REGISTERED_DIAGNOSTICS to a ParseSess field #48808
- Remove syntax and syntax_pos thread locals #48811
- Make CodeMap and FileMap thread-safe #48904
- Make CrateMetadata and CStore thread-safe #48936
- Misc changes from my parallel rustc branch #49030
- Make queries thread safe #49045 - make queries thread-safe
- Make Handler more thread-safe #49349
- Make OnDiskCache thread-safer #49396
- Even more thread-safety changes #49558
- Make incremental compilation thread-safe #49732 - make incremental compilation thread-safe
- Make SelectionCache and EvaluationCache thread-safe #49834 - Make SelectionCache and EvaluationCache thread-safe
- More thread-safety changes #49882 - More thread-safety changes
- Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString #49894 - Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString
- Make GlobalCtxt thread-safe #50108 - Make GlobalCtxt thread-safe
- Blocking Rayon queries #50699 - Blocking Rayon queries
- Run some stuff in parallel #51383 - Run some stuff in parallel
- Make more passes incremental #51487 - Make more passes incremental
- Replace LockCell with atomic types #56614 - Replace LockCell with atomic types
- Add support for using a jobserver with Rayon #56946 - Add support for using a jobserver with Rayon
- Optimize try_mark_green and eliminate the lock on dep node colors #57065 - Optimize try_mark_green and eliminate the lock on dep node colors
- Parallelize and optimize parts of HIR map creation #57232 - Parallelize and optimize parts of HIR map creation
- Make CompileController thread-safe #57308 - Make CompileController thread-safe
- Move privacy checking later in the pipeline and make some passes run in parallel #58010 - Move privacy checking later in the pipeline and make some passes run in parallel
- Combine all builtin late lints and make lint checking parallel #58019 - Combine all builtin late lints and make lint checking parallel
- Refactor passes and pass execution to be more parallel #58679 - Refactor passes and pass execution to be more parallel
- Use arenas to avoid Lrc in queries #1 #59540 - Use arenas to avoid Lrc in queries Thread a session or semantic context through IL #1
- Use arenas to avoid Lrc in queries #2 #59545 - Use arenas to avoid Lrc in queries bind's glue function should tail-call its target #2
- Clean up jobserver integration #59804 - Clean up jobserver integration
- Make trait_methods_not_found use a lock #59809 - Make trait_methods_not_found use a lock
Issue creation
- Issues created for individual pieces of state, together with a tracking issue