docs: memo on wasmtime FACT reusability for Christof Petig#105
Merged
Conversation
Rethinks the claim that meld's fact.rs cannot be used from wasmtime. The honest conclusion is "cannot be dropped in as-is" — much weaker than "the emission logic is unshareable." The pure emission core (transcoders, list copies, record lift/lower, helpers like emit_checked_realloc) is shareable; ~1500 LOC could become a third crate that both meld-core and wasmtime-environ depend on. Also notes that LS-A-7 (the realloc overflow + null-check audit we just landed across 19 sites) is likely reproducible on wasmtime FACT, since both have the same emission pattern. Drafted for Christof Petig as a starting point for a possible collaboration discussion. Co-Authored-By: Claude Opus 4.7 (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
Memo at `docs/wasmtime-fact-reusability.md` rethinking whether meld's `adapter/fact.rs` can be reused from wasmtime.
The original claim was "cannot be used from wasmtime." Christof Petig was rightly skeptical even after seeing our work. After rereading both code-bases (meld's fact.rs vs wasmtime-environ's `src/fact/`), the honest conclusion is:
Includes a side-by-side architectural comparison, the equivalent function table, and three options for sharing (third crate, meld imports wasmtime FACT, wasmtime imports meld). Recommends the third crate.
Bonus observation: the LS-A-7 audit we just landed (19 realloc sites missing overflow + null guards) is likely reproducible against wasmtime FACT — same emission pattern, same likely missing guards. Worth flagging upstream.
Test plan
🤖 Generated with Claude Code