Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6f86f87
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
6dc206d
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
c413659
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
0917763
Fix CI: drop v1 #[test] census witness that tripped migration-debt ra…
briansrls Jul 20, 2026
c5a905e
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
a94be50
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
dca58e0
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
401a11b
Fix CI: compile errors in resolution divergence positive control.
briansrls Jul 20, 2026
89a75b4
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
8ec70db
Fix CI: build_module_item_index takes InterpContext, not im_rc::Vector.
briansrls Jul 20, 2026
bddf316
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
479f150
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
214a26d
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
94deaba
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
aee16da
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
09080e3
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 20, 2026
284e8e9
WIP: Namespace lane: the resolution divergence census (brief = docs/p…
briansrls Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dag/tools/self_host_realized_comparison_transport.dag
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ fn realized_comparison_args() -> List<String> {
]
}

fn realized_comparison_verify_args() -> List<String> {
concat(realized_comparison_args(), ["--verify"])
}

fn run_self_host_realized_comparison_emit() -> Bool {
run_witness_bin_program(
invoke: realized_comparison_invoke(),
Expand Down
4 changes: 4 additions & 0 deletions src/v1/stage0/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ path = "src/bin/complexity_linearity_audit.rs"
name = "measure_whole_tree_resolve"
path = "src/bin/measure_whole_tree_resolve.rs"

[[bin]]
name = "resolution_divergence_census"
path = "src/bin/resolution_divergence_census.rs"

[[bin]]
name = "measure_dependency_view_build"
path = "src/bin/measure_dependency_view_build.rs"
Expand Down
84 changes: 84 additions & 0 deletions src/v1/stage0/src/bin/resolution_divergence_census.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#![allow(clippy::disallowed_macros)]

//! Namespace-resolution-design §12.4 census — read-only comparison of
//! `lookup_resolved_sig` vs SymbolIndex containment walk.
//!
//! ```text
//! cargo run -p v1-compiler --bin resolution_divergence_census
//! cargo run -p v1-compiler --bin resolution_divergence_census -- --source-root dag
//! ```

use std::path::PathBuf;
use std::process::ExitCode;

use v1_compiler::cli_run::{
format_resolution_divergence_census, resolution_divergence_census_live,
resolution_divergence_census_source_roots, whole_tree_resolve_exclusion_substrings,
};

fn workspace_root() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../..")
.canonicalize()
.expect("workspace root")
}

fn require_value(args: &[String], idx: usize, flag: &str) -> Result<String, ExitCode> {
match args.get(idx) {
Some(v) => Ok(v.clone()),
None => {
eprintln!("resolution_divergence_census: {flag} requires a value");
Err(ExitCode::from(2))
}
}
}

fn run() -> Result<ExitCode, ExitCode> {
let ws = workspace_root();
let args: Vec<String> = std::env::args().collect();
let mut source_roots: Vec<String> = Vec::new();
let mut exclude = whole_tree_resolve_exclusion_substrings();

let mut i = 1;
while i < args.len() {
match args[i].as_str() {
"--source-root" => {
i += 1;
let rel = require_value(&args, i, "--source-root")?;
source_roots.push(ws.join(&rel).to_string_lossy().into_owned());
}
"--exclude-subpath" => {
i += 1;
exclude.push(require_value(&args, i, "--exclude-subpath")?);
}
other => {
eprintln!("resolution_divergence_census: unknown argument: {other}");
return Err(ExitCode::from(2));
}
}
i += 1;
}

if source_roots.is_empty() {
source_roots = resolution_divergence_census_source_roots(&ws);
}

let census = resolution_divergence_census_live(&source_roots, &exclude).map_err(|e| {
eprintln!("resolution_divergence_census: resolve failed:\n{e}");
ExitCode::from(2)
})?;
let report = format_resolution_divergence_census(&census);
println!("{report}");
if census.sites_checked == 0 {
eprintln!("resolution_divergence_census: no bare call sites in resolved corpus");
return Err(ExitCode::from(2));
}
Ok(ExitCode::SUCCESS)
}

fn main() -> ExitCode {
match run() {
Ok(code) => code,
Err(code) => code,
}
}
Loading
Loading