test(ls-p-16): runtime oracle for lone-surrogate U+FFFD replacement#247
Merged
Conversation
LS-P-16's structural-follow-up (trap → Canonical-ABI lossy U+FFFD replacement) shipped in v0.11 but was only pinned structurally; the "no regression test for UTF-16 inputs ending on a high surrogate" causal-factor stayed open. Now closed with an executing oracle. test_sr17_utf16_to_utf8_lone_high_surrogate_replacement fuses a UTF-16-lowering caller passing [0x0041, 0xD800] (a lone trailing high surrogate) into a UTF-8 callee and asserts under wasmtime that the output is 'A' + U+FFFD (UTF-8 EF BF BD, byte sum 684) — proving lossy replacement, not a trap or the original OOB read. Reuses build_caller_utf16_lowering_component from #246. LS-P-16 marked follow-up-closed (with the mid-string lone-surrogate case recorded as a residual: only the end-of-input lone surrogate has a defined U+FFFD path). SR-17 traceability residual narrowed accordingly. Test-only (adapter_safety.rs is not Tier-5); fact.rs untouched. Workspace 542/0, LS gate 45/45/0-missing, clippy/fmt clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
LS-N verification gate✅ 45/45 approved LS entries verified
Approved Failed LS entries(none) Missing regression tests(none) Updated automatically by |
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.
Closes the last open causal-factor on LS-P-16 and narrows SR-17's residual to zero runtime gaps.
What
LS-P-16's lossy U+FFFD upgrade (trap → replacement) shipped in v0.11 but was pinned only structurally (an opcode-presence test). Its own entry flagged "no regression test for UTF-16 inputs ending on a high surrogate." This adds the executing oracle, reusing the UTF-16-lowering caller landed in #246.
test_sr17_utf16_to_utf8_lone_high_surrogate_replacement: fuses a caller passing[0x0041, 0xD800](lone trailing high surrogate) into a UTF-8 callee, runs under wasmtime, asserts output is'A' + U+FFFD(UTF-8EF BF BD, byte sum 684) — proving lossy replacement, not a trap or the original OOB read.Records
follow-up-closed(mid-string lone surrogate recorded as a residual: only end-of-input has a defined U+FFFD path).Tier-5
None —
adapter_safety.rsis a test file;fact.rsuntouched. Workspace 542/0, LS gate 45/45, 0 missing, clippy/fmt clean.🤖 Generated with Claude Code