Repository navigation
Description
What happens
ydoc::decode (crates/thrust-editor-doc/src/ydoc.rs) panics inside yrs 0.28.0 on an update that has been mutated by a single byte:
thread 'prop_decode_never_panics_on_mutated_updates' panicked at yrs-0.28.0/src/block.rs:92:13:
assertion failed: value & Self::MASK == 0
decode calls Update::decode_v1, then apply_update, then reads the fragment; the test catches the panic around all of it, and I have not narrowed which of the three it is in.
The property test that finds it, thrust-editor-doc's prop_decode_never_panics_on_mutated_updates (tests/roundtrip.rs), is randomized and has no committed regression file, so it fails only when the draw reaches the case. When it does, hermetic is red and so is gate, for any pull request, whatever it changed.
Evidence
-
CI, 2026-11-10: PR ci(oracle): run the v1 oracle as three cells of the contract matrix #113 (it changed no Rust), run 42864676520, job
hermetic, heade591b29. Proptest seedcc 1f4f49f134f46a92171befaad1d56f43b58eb0e14a6fd564d00fb2433caa58cb; the shrunk input is in the job log. The next three runs on new draws passed (43a17da,1a808c5, andmainat69c099e): that is not a fix, it is a different seed. -
Local, 2026-11-09 (found while working on feat(api): /api/v1 projects, states, labels and work items with the oracle gate on those operations #58, unrelated to v1): a much smaller counterexample, seed
cc 8a5e8163776469da889f53c4e6c7485505b437ed3403224ed79869ac43a96ba4, shrinks tospec = [Tasks([(false, ([Text { text: "aé<><😀😀", marks: [] }], [Heading { level: 1, inline: [] }]))])], edits = [(Index(2522631668199596803), 0, 1)]that is one document block, and one edit of kind 1: insert a single
0byte into the encoded update.
Why it matters
- The property is Thrust's own statement that decoding outside bytes never panics, and the repo's panic policy (ADR-0006,
Cargo.toml: "request-derived data can never panic, because on the Worker (panic=abort) a panic fails its own request") is written for exactly this. On native the server keeps unwinding (CatchPanicLayer), but wasm32 on stable is alwayspanic=abort, so acatch_unwindat the call site is not available to the Worker. - Reach today is small.
ydocis behind theyjsfeature (default on). The product cratesthrust-api-v1andthrust-compat-planeturn defaults off and takesanitizeonly, so yrs is not in them. The one non-test caller isthrust-editor-worker(Spike 0006):POST /binary-to-allbase64-decodes the request body and passes the bytes toydoc::decode. I have not checked whether that Worker is deployed anywhere. Collaboration persistence (ADR-0061) would put this on a product path.
Not done, and what is open
- I have not re-run the two seeds since; the local working tree was removed before I could. To reproduce, put the two
cclines incrates/thrust-editor-doc/tests/roundtrip.proptest-regressionsand runscripts/rs cargo nextest run -p thrust-editor-doc -E 'test(prop_decode_never_panics_on_mutated_updates)'(proptest replays saved seeds first).[unverified: not re-run] - I have not checked whether a newer
yrsfixes it, or whether it is already reported upstream. - Ways to close it, none chosen: a newer or patched
yrs; a check on the bytes before they reach yrs (I do not know what would be enough, nor whether the panic is indecode_v1or later); or an upstream report with the one-byte case above. Repo rule 3 applies to the test: it stays as it is, it is not ignored, weakened or retried. - Committing the two seeds as a regression file is right once a way to close it is chosen; committed now, it makes
hermeticfail on every run until then.
Activity
aRustyDev commentedon Nov 16, 2026
Another occurrence in CI, 2026-11-16, same panic (
yrs-0.28.0/src/block.rs:92:13: assertion failed: value & Self::MASK == 0):hermetic, head6494c60.thrust-editor-doc'sprop_decode_never_panics_on_mutated_updates(tests/roundtrip.rs).cc 50d0a0a0c0cdeb956df3a1d85ca0644235d5c726e5e0ae9a4d8bccea33057722. The shrunk input is in that job's log.Still no committed regression file, so any pull request's
hermetic, andgatewith it, can turn red at random until this is fixed.🤖 Generated with Claude Code
ci(test): build the hermetic job without debug info (Test phase, stag…
docs(ci): state the nightly deep job's duration from the four runs me…
ci(test): run the randomized tests at 4096 cases every night, not gat…
docs(testing): record the end of stage 3 of the Test phase: G-48 done…