Skip to content

Sync rocicorp/mono main (0499748) - #282

Merged
tmm merged 14 commits into
mainfrom
sync-upstream-11
Nov 30, 2026
Merged

tmm merged 14 commits into
mainfrom
sync-upstream-11

Conversation

@tmm

@tmm tmm commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Land with a merge commit, not a squash.

10 upstream commits, d1bfa20..0499748, merged with no conflicts. The merge touches no file restored by #188 (tools/restored-tests/verbatim.txt hashes all match), and align-manifests.mjs changed nothing.

Client-relevant

  • 0499748 feat(zql): order JSON strings before numbers in min/max: needs a port, done here. When min or max reduces a JSON path that holds both strings and numbers, strings now order before numbers, as in Postgres's jsonb order. Before, numbers came first. It regenerates 12 vectors, all min/max over a JSON path: 9 in bughunt-ivm.json and 3 in ivm-features.json.
    • test(zero-conformance): commits the regenerated vectors.
    • fix(zero-swift): swaps the cross-type cases of compareAggregateValues and updates its doc and min(json:)'s.
    • fix(zero-rust): the same in compare_aggregate_values and min_json's doc.
    • Each client gets a patch changeset that flags the behavior change.
    • The z2s part of the commit compiles the same order into the server's Postgres SQL, with strings compared by UTF-8 bytes (COLLATE "C").
  • 2e9ac39, 8a438c9, 09a1096, 29871ac, 048775a, fabeba1, 37b4d93, afdd254 perf(zql): push and fetch through the IVM operators with iterators instead of generators. These don't change output: every vector other than the 12 min/max cases is byte-identical. Swift and Rust have their own operators, so there's nothing to port.

Compatibility

  • PROTOCOL_VERSION stays 57, and the only zero-protocol change is a doc comment. min/max still arrive in a synced aggregate row's _0_value as a JSON number or string.
  • Synced views read min/max from zero-cache's rows on every client (aggregatesFromSource), and min/max get no optimistic deltas. So clients on either order show whatever order their zero-cache uses.
  • Only a mutator's query that the server hasn't answered yet computes min/max on the client. If it gives a different value from the API server's run, the server's result replaces it.
  • After zero-cache upgrades to this order, a CVR already at the replica's version is rehydrated without a row diff, and its drift check only hashes row keys. A min/max computed by the old zero-cache can stay on clients until that group's value changes or the replica advances first. This is from reading the code; it hasn't been reproduced.

Server-only

  • 8d47977 (zero-cache): propagates errors during background retransform.

Lockfile follow-up

None. pnpm install --frozen-lockfile passed with the lockfile unchanged.

Checks run

  • zero-conformance: generate and test (27 files, 265 tests; the vectors are current) and check-types.
  • zero-swift-cli: test (29/29) and check-types. zero-rust CLI test (25/25). pnpm exec syncpack lint. oxfmt on rust and the new changesets.
  • Swift (Linux): swift format lint --strict, swift build --build-tests, and swift test --skip-build --skip E2ETests, with 383 tests in 62 suites passing. That includes BugHuntTests.ivm (206 cases) and IVMConformanceTests.features. Control: with the old comparator those two fail exactly the 12 changed cases.
  • Rust: cargo fmt --check, and cargo run --release -p zero-conformance -- --require-generated replayed all 66,384 cases with 0 failures. Control: with the old comparator it fails exactly the 12 changed cases.

Changesets

zero-swift patch and zero-rust patch, for the min/max order.

Land with a merge commit so upstream stays an ancestor of main and the port commits stay separate.

arv and others added 14 commits November 25, 2026 09:33
… to it

Mono-Internal-Commit: 274395e880e8d73d3aeeffd63c701c006ec842a3
…tors

Mono-Internal-Commit: b957de279c9d61da4807ca5f927a034374d7d8c9
Mono-Internal-Commit: e7e3d993d0ac22a40517b995ac0158aae0c117a6
Mono-Internal-Commit: 7a419dc46d804d251e005e4841ffa6c698342dbd
Mono-Internal-Commit: 4bd10adb4a88f9f6f550336e9df09a42e53725b8
Mono-Internal-Commit: c0d80fc2344bdd503a24844a90e4e7f494665a99
Mono-Internal-Commit: b05435ccf3645bf3249dc2080721a97c0b964efb
Mono-Internal-Commit: cd191f6b80ede346451216e1493461e6446116fd
Mono-Internal-Commit: 5063d1b271968f9f88740bbc8548f60140ebe98c
Mono-Internal-Commit: 2cd6abc6c56caac4c494677de81d6007e3078b5d
…-first min/max

Upstream's 0499748 orders JSON strings before numbers when min/max reduces a JSON path. 12 cases change: 9 in bughunt-ivm.json and 3 in ivm-features.json, all min/max over a JSON path.

Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
Ports upstream's 0499748: when min or max reduces a JSON path that holds both, strings now order before numbers, as in Postgres's jsonb order.

Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
Ports upstream's 0499748: when min or max reduces a JSON path that holds both, strings now order before numbers, as in Postgres's jsonb order.

Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
@tmm
tmm merged commit 8008b4b into main Nov 30, 2026
28 of 29 checks passed
@tmm
tmm deleted the sync-upstream-11 branch November 30, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants