test: bring the v2 smoke to parity with v1's #92
No reviewers
Labels
No labels
area:defold
area:docs
area:infra
area:protocol
area:testing
kind:bug
kind:chore
phase:breadth
phase:core
phase:hardening
phase:slice
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
yuris/spacetimedb-defold!92
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "flip-smoke-parity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Gate 3 of #89. The v2 wire asserted strictly less than v1 did, which is not a wire you promote to default. Three gaps closed.
One-off query, both wires. Neither wire tested it before (
grep -c one_offwas 0). PHASE4 now issuesSELECT * FROM messageand asserts no error plus at least one row. The per-wire shape is asserted where it genuinely differs: on both wires the row must be a non-empty byte string — a row arriving as a Lua table fails with its type printed — and on v1 it must additionally decode as JSON, done through the un-instrumentedraw_decodelocal so nothing is billed into PHASE6's buckets.Sliced apply over BSATN, unit level.
test_slicing.luanever touchedcache.row_decoder, so frame-budget slicing over BSATN had no automatic coverage at all. One case now applies 600 BSATN rows (>SLICE_ROWS) withrow_decoder = protocol_v2.decode_typed_bsatnand asserts the slice hook fired, all 600 landed, and both columns of every row decoded correctly. It drivesapply_database_updatedirectly rather than going throughconnect, because the pump ownsslice_hookwhile it runs so a counting hook cannot coexist with a yielding one; the two paired for real is PHASE6's sliced run.v2 stand-in for the light assertion. v1's PHASE1 asserts
light = truestill delivers the caller's own full update; v2 has nolight. The v2 guarantee is stronger, so it is asserted instead: theReducerResult::Oktable handed to the callback and the table thetransactionevent carries must be the SAME table underrawequal— single-frame inline delivery, not merely both arriving. Gated on the existingtx_reducerrequest_id correlation so a foreign commit is not read as our own frame gone missing.Each new assertion was proved to bite by breaking it deliberately (decoder removed, values shifted, row count lowered below one slice).
Pre-existing finding, not fixed here.
STDB_BULK_BUDGETis in SECONDS, so the sliced run needs0.008to mean 8ms. At the default 10000-row sweep, v2 with a real 8ms budget fails the PHASE6 gate — BSATN decode finishes the apply in one frame, so nothing slices. Verified identical on basemainwith these changes stashed. The corrected proof isSTDB_PROTOCOL=v2 STDB_BULK_BUDGET=0.008 STDB_BULK_SWEEP=50000. Whether the default sweep should scale with wire speed is a separate question and deliberately not answered inside a smoke-parity change.All four engine runs green locally: v1 native, v2 native (12.1ms vs v1's 21.7ms for 10000 rows), v2 sliced (50000 rows over 6 frames at 8.0ms), v2 HTML5 (handshake asserted
v2.bsatn.spacetimedb, green first attempt).ddff5d683826ddc8cbf526ddc8cbf5a7432950ca