Commit graph CultLib/tests/GameCult.Networking.Tests/NetworkingTests.cs
Author SHA1 Message Date
Meta Vens
7c4bc2bdc0 Make generated and reflective document members one rule
The generator and CultDocumentRegistry now discover members by the same
steps: most-derived declaration first, override chain collapsed to one
member, attributes read up the override chain, rejections in one order
with one text (GCC001 / InvalidOperationException).

- Accessors are named per document, so documents sharing a [CultName] or
  [CultIndex] base member no longer emit duplicate methods (CS0111).
- Duplicate [Key] slots are refused, including new-hidden fields and
  properties; a hidden persisted member with a different slot is refused.
- String [Key("x")] gets its own message instead of "has no [Key]".
- A persisted property whose set accessor is private, protected or init,
  or a readonly field, is refused instead of CS0272 in generated code.
- Overrides: MessagePack's DynamicObjectResolver reads the base
  declaration's [Key]/[IgnoreMember] (it throws "key is duplicated" for a
  re-keyed override and serializes an override marked [IgnoreMember]).
  An override that changes them is refused in both paths; an override
  that repeats or omits them is accepted and byte-pinned.
- Typed Serialize<T>/Deserialize<T> used static Options and skipped
  generated codecs and declared resolvers; deleted. CultNetDocumentBinding
  and CultMeshSnapshots route through the untyped path with their registry.

DocumentShapeSweepTests compiles each shape through the generator and
compares generated vs reflective schema id, catalog, name/index values
and payload against MessagePack's own bytes, or equal rejection text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:00:16 +02:00
Meta Vens
456234018f Carry order as data: per-cache change Sequence, no delivery scheduler
bcae483 made the cache a delivery scheduler (tickets, _deliveryGate turn
waits, per-thread delivery queues). It deadlocked inside CultLib: a load's
delivery reaching a CultNetDatabaseSubscriptionServer observer that needs
_lifecycleGate, while a subscribe's demand handler holding that gate writes
the cache and waits for the delivery's turn.

The cache now owns order as data. Every admitted change takes the next value
of a per-cache in-memory sequence under the gate, published as
CultCacheDocumentChange<T>.Sequence. Delivery is the 544c087/b653f68 rule:
each call publishes its own changes on its own thread after releasing the
gate; nothing waits on another call's delivery. Cross-thread delivery order is
not guaranteed.

Deleted: ticket counter, _delivered, _deliveryGate, Monitor.Wait turns,
per-thread delivery queues, per-ticket catch-all, and the save-order contract
text with its observer-must-not-block rule.

Consumer: a cache-backed CultMesh document handle hands its observed and
reactive mirrors each snapshot's Sequence; ApplyCanonicalSnapshot drops one
not newer than the last applied.

Tests: SequenceIncreasesInAdmissionOrder,
ObserverWritingTheSameCacheDoesNotWaitOnOtherDeliveries,
SubscriptionDemandHandlerWritingCacheDuringDeliveryDoesNotDeadlock,
WatchRecordIgnoresStaleSequence. The last three time out on bcae483.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 20:43:11 +02:00
Meta Vens
03a71ebd66 Pin CultNet publish-after-commit, add write-routed interop, update contract status
- NetworkingTests.CultNetPutInsideCommitPublishesOnlyAfterCommit: a record
  staged in a batch reaches no CultNet observer before the store commits; a
  put made while staging is its own write. Chosen over refusing CultNet writes
  inside a batch, which would need ambient "inside a batch" state.
- Interop peer mode write-routed <catalog.cc> <run.cc>: cultcache.interop-note
  routes to the catalog file, cultcache.interop-run-note to the run file, one
  record each.
- store-composition contract: the C# column reads implemented for routing,
  attach, schema, lookups, globals, batch and conditional commit; overwriting
  a store is open, remove, upsert, flush. persistence-format: C# implements
  batch and conditional commit.
- tests README lists the new suites.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 17:58:00 +02:00
Meta Vens
88e1c8e157 Delete CultNetDatabase's transaction wrapper
ExecuteTransactionAsync (both overloads), RequireTransactionsForAuthoritativeWrites,
EnsureAuthoritativeTransaction and the AfterCommit deferral had no consumer
outside CultNetDatabase_RequiredTransaction_DefersRawPutPublicationUntilCommit,
deleted with them. Writes publish immediately, as they already did outside a
transaction. The cache's own transaction machinery stays until Cut 3 replaces
it with the explicit batch commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 16:35:56 +02:00
Meta Vens
8d3025816d Align RUDP reliability tests with sequence domains 2026-09-04 00:33:23 +02:00
Meta Vens
0736ae4824 Separate RUDP reliable and lossy sequence domains 2026-09-04 00:33:16 +02:00
Meta Vens
334e60f192 Recover authority-bound CultMesh and atomic generations 2026-08-26 19:01:24 +02:00
Meta Vens
75c180782a Acknowledge retransmits across RUDP horizons 2026-08-23 19:15:22 +02:00
Meta Vens
fda51fad50 Acknowledge reliable RUDP windows cumulatively 2026-08-23 19:00:33 +02:00
Meta Vens
f4dabfefb0 Bound RUDP reliable transmission windows 2026-08-23 18:35:49 +02:00
Meta Vens
73ab8b65e1 Reconcile live subscription authority 2026-08-19 13:55:03 +02:00
Meta Vens
eaf1189cc1 Project subscription records per peer 2026-08-19 13:24:51 +02:00
Meta Vens
0a885afce7 Authorize database subscription records 2026-08-19 12:12:52 +02:00
Meta Vens
e80383c33f Make CultCache transactions atomic to observers 2026-08-19 01:44:17 +02:00
Meta Vens
6c848bd6c0 Bind CultMesh authority identity to physical routes 2026-08-18 17:21:58 +02:00
Meta Vens
c5d9435deb Carry portable schema identity on raw records 2026-08-18 02:08:49 +02:00
Meta Vens
3fe2e9be1b Publish browser subscription wire contracts 2026-08-17 23:26:51 +02:00
Meta Vens
6beca4a80a Preserve peer locality across schema transports 2026-07-19 18:50:22 +01:00
Meta Vens
0ef59b50c2 Materialize exact reactive state on demand 2026-07-19 12:33:03 +01:00
Meta Vens
a1f25af2e0 Keep exact live subscriptions active before publication 2026-07-19 11:49:18 +01:00
Meta Vens
736b1f9278 Add exact reactive value subscriptions 2026-07-19 09:23:39 +01:00
Meta Vens
fd070cc8b2 Serialize concurrent RUDP session publication 2026-07-19 08:36:09 +01:00
Meta Vens
42402ab64b Deliver reactive subscriptions without replica writes 2026-07-19 08:07:48 +01:00
Meta Vens
4f816a4926 Withdraw reactive state when peers disconnect 2026-07-19 06:40:05 +01:00
Meta Vens
743fa3889e Stream exact hot state over negotiated body planes 2026-07-19 05:54:24 +01:00
Meta Vens
3e223ceecd Negotiate exact hot-body transport demand 2026-07-19 03:17:11 +01:00
Meta Vens
3093b536d4 Release CultLib Unity package 1.0.17 2026-07-18 22:34:22 +01:00
Meta Vens
bb7e06ba1e Synchronize RUDP resend acknowledgements 2026-07-17 13:17:09 +01:00
Meta Vens
a311cbe8cb Improve managed content throughput 2026-07-14 03:26:43 +01:00
Meta Vens
7737d3f2f4 Merge remote-tracking branch 'origin/codex/cultmesh-document-handles' into codex/cultmesh-reliability-control-plane 2026-07-13 02:04:36 +01:00
Meta Vens
a58daa54c7 Allow CultMesh RUDP clients on remote routes 2026-07-12 20:18:13 +01:00
Meta Vens
0a678c6e3a Move Verse discovery ownership into CultMesh 2026-07-12 20:17:57 +01:00
Meta Vens
fc65e25fd5 Establish CultMesh reliability failure harness 2026-07-12 19:56:20 +01:00
Meta Vens
b5529435c3 Replicate live typed documents over retained sessions 2026-07-12 12:19:49 +01:00
Meta Vens
4d8d43621d Stream database subscriptions through schema servers 2026-07-12 12:05:31 +01:00
Meta Vens
5f1583b3c0 Close RUDP schema client sessions cleanly 2026-07-12 10:53:05 +01:00
Meta Vens
c398bad186 Deliver large scoped snapshots reliably 2026-07-12 08:42:08 +01:00
Meta Vens
94f95e380d Expose operation envelopes in CultNet CSharp 2026-07-10 11:17:33 +01:00
Meta Vens
905c5254b4 Reuse CultMesh snapshot connections 2026-07-10 06:37:10 +01:00
Meta Vens
19e2b68fec Resolve C# raw deletes by schema alias 2026-06-27 22:07:31 +01:00
Meta Vens
7661cf7af3 Resolve C# shard routing by schema alias 2026-06-27 22:04:16 +01:00
Meta Vens
1b9140da3d Resolve C# subscription filters by schema alias 2026-06-27 21:53:28 +01:00
Meta Vens
cfed4ea7ef Resolve C# shard catalog filters by schema alias 2026-06-27 21:39:27 +01:00
Meta Vens
4dfa9a6162 Resolve C# snapshot filters by schema alias 2026-06-27 21:37:03 +01:00
Meta Vens
8b58208dff Resolve database raw puts by payload schema 2026-06-27 21:22:25 +01:00
Meta Vens
f06914d7c5 Add C# RUDP schema service host 2026-06-17 14:48:53 +01:00
Meta Vens
1c85eabefb Add C# multi-peer RUDP listener 2026-06-17 14:28:18 +01:00
Meta Vens
9621d310f0 Route C# mesh clients through RUDP endpoints 2026-06-17 13:54:11 +01:00
Meta Vens
114fb86b0f Add C# RUDP schema client adoption path 2026-06-17 13:27:56 +01:00
Meta Vens
5af8ed57f7 Add C# CultMesh connected RUDP clients 2026-06-17 05:16:46 +01:00