Build semantic lineage analysis #26
No reviewers
Labels
No labels
area/cli
area/core
area/database
area/indexing
area/query
type/epic
type/feature
type/foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
JayKobe6k/ClariTree!26
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-11-lineage-analysis"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Tests
nix develop --command cargo fmt --all -- --checknix develop --command cargo lintnix develop --command cargo test --all-targets --all-featuresnix develop --command cargo doc --no-deps --all-featuresnix develop --command cargo check --target x86_64-pc-windows-gnu --all-featuresCloses #11
Found four actionable lineage-analysis defects.
@ -633,0 +640,4 @@}fn source_range_is_valid(start: &ValueSourcePoint, end: &ValueSourcePoint) -> bool {start.path() == end.path() && start.byte_offset() <= end.byte_offset()[P1] This requires a spelling range's endpoints to share one file, but libclang can emit a macro operation whose spelling starts in the defining header and ends at the expansion site. A valid
return ADD_ONE(input);probe therefore makesanalyzefail withInvalidDefinitionAnchor, aborting the entire index. Please preserve this mixed spelling/expansion provenance or normalize the operation anchor before validation, and cover a header-defined expression macro.@ -0,0 +858,4 @@AnalysisCertainty::Possible,),)));self.bind_known_alias_effects([P1] Known-call effect binding here covers only parameter-rooted alias writes, so direct writes to globals never enter the caller's
call_effects. Inset_shared(); return shared;, the pre-call initializer remains the sole certain producer and the callee assignment is disconnected. Please summarize and project callee writes to canonical global storage as well as pointer-parameter effects.@ -0,0 +1145,4 @@.iter().filter(|value_use| {value_use.operation == call.operation&& matches!(value_use.role, ValueUseRole::Argument(_))[P2] This filter excludes the indirect callee's
Operanduse even though that value selects the code producing the result. Forreturn function(value);, the result derives only fromvalue, so lineage from the function-pointer definition stops before the call result. Please include the indirect callee use as aPossible(IndirectCall)result derivation while keeping alias-effect creation restricted to arguments.@ -0,0 +1393,4 @@fn callable_seeds(&self, unit_index: usize, callable: CallableId) -> ReachingState {let mut state = ReachingState::new();for definition in self.definition_info[unit_index][P1] Seeding only
definition_info[unit_index]keeps file-scope storage separated by translation-unit-localSymbolId. Withextern int sharedin one unit andint shared = 7in another, the caller's read is reached only by a synthetic external definition, while the real initializer is disconnected. Please reconcile external-storage globals by canonicalSymbolKeyacross units and seed each caller from the project-wide definition.cdbe3245bf' into issue-11-lineage-analysis 59c39bc9e2Review comment #1077: Fixed in
80e3b58. Occurrence validation now orders offsets only when endpoint paths match, while preserving distinct spelling/expansion endpoint paths for mixed-file macro locations. Regression:header_defined_expression_macro_preserves_mixed_source_anchors; full all-target/all-feature tests, lint, rustdoc, and Windows target check passed.Review comment #1081: Fixed in
7b64cb0. Direct and transitive known-callee global writes are summarized and projected into caller state before subsequent reads. Regression:transitive_known_calls_project_global_writes_to_the_caller; full validation passed.Review comment #1079: Fixed in
7b64cb0. Project analysis now reconciles externally linked globals by typedSymbolKey, allowing initializers and uses in different translation units to share reaching-definition state. Regression:external_global_initialization_reaches_reads_in_another_translation_unit; full validation passed.Review comment #1082: Fixed in
7b64cb0. Indirect-call result definitions now depend on the evaluated callee operand as well as arguments, without introducing unsupported alias effects. Regression:indirect_callee_values_derive_call_results_without_alias_effects; full validation passed.Review comment #1079: Follow-up hardening is pushed in
1d05096,4596fa2, and979eba6: canonical global effects now traverse intermediate translation units without declarations, unknown/indirect calls include project-visible external symbols, and internal-linkage resolution remains confined to the owning compilation context. Added direct-static, three-TU known/unknown-call, and repeated-compilation regressions. Full required validation passed.Review comment #1081: Follow-up hardening is pushed in
1d05096,4596fa2,979eba6, and992a10a: call summaries now preserve CFG-aware certainty, ternary control flow, nested/direct effect order, reachability, and certainty when the same definition is repeated. Regressions cover conditional/loop/ternary writes, nested overwrites, unreachable writes, recursion, and repeated calls. All PR checks passed, and a temporary resolved #26+#27 integration tree passed 188 tests plus lint, rustdoc, Windows cross-check, and diff checks.