Skip to content

Re-enable resource graph definer propagation (targeted) #74

@avrabe

Description

@avrabe

Part of #69, depends on #73

Task

The resource graph needs to propagate definers through re-export chains so that callee_defines_resource is correctly set to false for runner→intermediate adapter sites.

A previous attempt caused an xcrate regression. The fix: only propagate when from_comp is a confirmed re-export target (another component imports from it) AND the export interface differs from the import interface.

Implementation

Files: meld-core/src/resource_graph.rs

After the existing removal pass in ResourceGraph::build, add targeted propagation:

let mut changed = true;
while changed {
    changed = false;
    for ((from_comp, import_name), (to_comp, _)) in resolved_imports {
        // Only propagate for confirmed re-export targets
        let is_reexport_target = resolved_imports.values()
            .any(|(target, _)| *target == *from_comp);
        if !is_reexport_target { continue; }
        
        // Find defined resources for to_comp matching import_name
        // Propagate to from_comp's [export] interfaces that carry same resource
        // Guard: export interface must DIFFER from import interface
    }
}

Branch

feat/per-component-handle-tables

Acceptance

cargo test --package meld-core passes including the xcrate fixture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions