analyssa/scheduling/mod.rs
1//! Pass-pipeline scheduling engine — orchestrates [`SsaPass`] execution
2//! across methods with capability-based layering, fixpoint iteration, and
3//! parallel dispatch.
4//!
5//! # Architecture
6//!
7//! The scheduler organizes passes into execution layers computed from their
8//! declared [capabilities](DeobfuscationCapability). Passes that provide a
9//! capability are placed before passes that require it, ensuring producers
10//! run before consumers.
11//!
12//! # Usage
13//!
14//! Hosts implement [`SsaPassHost<T>`] on their context type (which bundles
15//! [`World<T>`](crate::world::World), [`SsaStore<T>`](crate::host::SsaStore),
16//! and [`DirtySet<T>`](crate::host::DirtySet)), register passes with a
17//! [`PassScheduler`], and call [`PassScheduler::run_pipeline`].
18//!
19//! # Features
20//!
21//! - **Capability-based ordering**: passes declare `provides`/`requires`;
22//! the scheduler topologically sorts them into layers.
23//! - **Fixpoint iteration**: each layer runs to convergence with normalize
24//! passes (DCE, GVN) interleaved between iterations.
25//! - **Parallel dispatch**: per-method pass execution via rayon.
26//! - **Modification-scope-driven repair**: after each pass, the scheduler
27//! applies the minimum SSA repair needed (uses-only, instructions-only,
28//! or full rebuild) based on the pass's declared
29//! [`ModificationScope`].
30//! - **Dirty tracking**: only methods that may have changed are re-processed
31//! on subsequent iterations, unless a pass declares
32//! [`requires_full_scan`](SsaPass::requires_full_scan).
33
34mod capability;
35mod pass;
36mod scheduler;
37
38pub use capability::DeobfuscationCapability;
39pub use pass::{ModificationScope, SsaPass, SsaPassHost};
40pub use scheduler::PassScheduler;