fix: strip $N suffix from resource name in resource tracking maps#86
Merged
fix: strip $N suffix from resource name in resource tracking maps#86
Conversation
The merger adds $N suffixes to deduplicated import field names in
multi-memory mode (e.g., [resource-rep]float$5). The resource_rep/new
_by_component maps must store the bare resource name ("float") so the
adapter generator can look up by (component_idx, resource_name).
Without this, the adapter falls back to the wrong component's import,
causing resource type mismatch at runtime.
Part of #69.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$Nmulti-memory dedup suffix from resource names when recording inresource_rep_by_componentandresource_new_by_componentmaps(5, "float")but the map contains(5, "float$5"), causing fallback to the wrong component's importDebugging findings
The adapter function body for the runner→intermediate call currently references
canon resource.rep 21(comp 0's type) instead ofcanon resource.rep 36(comp 5's type). The$Nsuffix stripping fixes the map lookup, but the adapter code generation (fact.rs) also needs work — the adapter call signature doesn't match the canonical function type for some adapters. This is the next layer to investigate.Part of #69.
Test plan
🤖 Generated with Claude Code