Catalog-member vectors: README names the extended shapes, the shared table and what C# cannot express (fix batch 2)
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 24m39s
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 24m39s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d0a149cd9e
commit
ccbabe7e23
1 changed files with 31 additions and 10 deletions
|
|
@ -5,18 +5,26 @@ Two stores holding the same record, `m:1` of type `tests.catalog_members` (versi
|
|||
every runtime keeps reading a store whose Rust-written entry holds `members []`.
|
||||
|
||||
- `csharp-members-store.cc` is written by the C# reference (`CatalogMemberVectorTests`, under `CULTCACHE_WRITE_VECTORS=1`; every other run compares
|
||||
the bytes). Its catalog entry carries the 17 rows below, in slot order, which is the order C# discovers members in.
|
||||
the bytes). Its catalog entry carries the 29 rows of `members.json`, in slot order, which is the order C# discovers members in.
|
||||
- `members.json` is the one expected table: `[slot, member, typeName, isReference, isMany, targetSchemaName, isName, indexAlias]` per row. C#, Rust,
|
||||
TypeScript and Python each read the catalog rows of `csharp-members-store.cc` and compare every row to it; none picks rows by hand.
|
||||
- `rust-members-empty-store.cc` is written by cultcache-rs at base e503edf2 (`packages/cultcache-rs/tests/catalog_members.rs`, `the_members_empty_store_vector`,
|
||||
under `CULTCACHE_WRITE_VECTORS=1`). It is the one vector in this folder C# does not write, and it is never regenerated: it pins the bytes old Rust wrote,
|
||||
and a later Rust writes member rows. A Rust-written entry has id = schema name = `tests.catalog_members`, version `tests.catalog_members.v1`, and `members []`.
|
||||
under `CULTCACHE_WRITE_VECTORS=1`). It is the one store in this folder C# does not write, and it is regenerated only by a reviewed commit with the Rust
|
||||
source of e503edf2: it pins the bytes old Rust wrote, and a later Rust writes member rows. A Rust-written entry has id = schema name = `tests.catalog_members`,
|
||||
version `tests.catalog_members.v1`, and `members []`. Its payload spells the slots through the Rust mirror below.
|
||||
|
||||
The type: a name (Title), a unique index (Sku), the scalar leaves, a nullable, a nullable string, a list, an array, a byte array, a list of byte arrays,
|
||||
a dictionary, a record (`Mark`: slot 0 Label string, slot 1 Weight int), a union (`Arm`: arm 0 `CatalogMemberTextArm {Text}`, arm 1 `CatalogMemberCountArm {Count}`),
|
||||
a gap at slot 16, and a slot above it (Late). The record holds: Title `Brass lantern`, Sku `LAN-0042`, Count -7, Total 10000000000, Ratio 0.25, Scale 1.5, Flag true,
|
||||
MaybeCount 3, Note `handle with care`, Tags [fragile, lit], Labels [a, b, c], Raw 00 01 02 FE FF, Chunks [09 08, 07], Weights {brass 12, glass 3},
|
||||
Mark {stamp, 5}, Arm Count 21, Late -9000000000.
|
||||
The type holds: a name (Title), a unique index (Sku), the scalar leaves, a nullable struct, a nullable string, a list, an array, a byte array, a list of byte arrays,
|
||||
a dictionary, a record (`Mark`: 0 Label, 1 Weight, 2 Id), a union (`Arm`: arm 0 `CatalogMemberTextArm {Text, Id}`, arm 1 `CatalogMemberCountArm {Count, Id}`), a gap at slot 16,
|
||||
a slot above it (Late), and slots 18-29: list, array and map of records, a record, a list of unions, a nested list, a map keyed by int, an enum, a Guid, a DateTime,
|
||||
a decimal, and an object. A record in a collection carries a `[CultElementId]` member, so the records and arms have an Id slot.
|
||||
|
||||
C# rows (slot, member name, typeName):
|
||||
What C# cannot express: a nullable record is the record's own type name (`MaybeMark` has no row of its own shape; nullable annotations on reference types are not
|
||||
in the typeName, and `MaybeCount` is the nullable struct row); a field type that names nothing in Rust is spelled in C# as `object` (`Opaque`, row `System.Object`),
|
||||
the row the library cut writes for a Rust field with no `type_name` (`variants:ruling:rs-member-unnamed-object-fallback`).
|
||||
|
||||
The Rust mirror reads the C# bytes: Guid and decimal as their strings, the enum as its int, DateTime as the timestamp extension (kept as bytes), `Opaque` as a newtype of String.
|
||||
|
||||
Rows (slot, member, typeName):
|
||||
|
||||
| slot | member | typeName | role |
|
||||
| --- | --- | --- | --- |
|
||||
|
|
@ -37,5 +45,18 @@ C# rows (slot, member name, typeName):
|
|||
| 14 | Mark | `GameCult.Caching.Tests.CatalogMemberMark` | |
|
||||
| 15 | Arm | `GameCult.Caching.Tests.CatalogMemberArm` | |
|
||||
| 17 | Late | `System.Int64` | |
|
||||
| 18 | Items | `System.Collections.Generic.List<GameCult.Caching.Tests.CatalogMemberMark>` | |
|
||||
| 19 | Marks | `GameCult.Caching.Tests.CatalogMemberMark[]` | |
|
||||
| 20 | ByLabel | `System.Collections.Generic.Dictionary<System.String, GameCult.Caching.Tests.CatalogMemberMark>` | |
|
||||
| 21 | MaybeMark | `GameCult.Caching.Tests.CatalogMemberMark` | |
|
||||
| 22 | Arms | `System.Collections.Generic.List<GameCult.Caching.Tests.CatalogMemberArm>` | |
|
||||
| 23 | Grid | `System.Collections.Generic.List<System.Collections.Generic.List<System.Int32>>` | |
|
||||
| 24 | ByNumber | `System.Collections.Generic.Dictionary<System.Int32, System.String>` | |
|
||||
| 25 | Kind | `GameCult.Caching.Tests.CatalogMemberKind` | |
|
||||
| 26 | Ident | `System.Guid` | |
|
||||
| 27 | When | `System.DateTime` | |
|
||||
| 28 | Price | `System.Decimal` | |
|
||||
| 29 | Opaque | `System.Object` | |
|
||||
|
||||
Readers: C# loads both stores typed (the Rust one with `defaulted_missing_slot` warnings only); Rust reads both records; TypeScript and Python read both stores and see 17 and 0 members.
|
||||
Readers: C# loads both stores typed (the Rust one with `compatible_schema_id_drift` x1, `content_hash_drift` x1 and `defaulted_missing_slot` x29, no refusal) and reads the catalog rows of both;
|
||||
Rust reads both records and the rows of both (raw catalog); TypeScript and Python read both stores and compare all 29 rows and 0 rows.
|
||||
|
|
|
|||
Loading…
Reference in a new issue