Repository navigation
Description
Summary
ChaosStressTests had a fixture-level [Ignore("Too long, should be manually executed when needed")] (test/Typhon.Engine.Tests/Data/ChaosStressTests.cs:22). NUnit applies [Ignore] unconditionally — --filter cannot override it — so "manually executed when needed" was not achievable without editing source, and these tests appear never to have run.
Changed to [Explicit] on branch epic-411 (keeps them off the default run, makes them selectable) and ran them. 5 of 23 fail deterministically — same 5 in all 3 runs. A 6th (Scale_4T_500E) fails intermittently (2 of 3). One more (CreateDeleteRecreate_RapidLifecycle) livelocks — filed separately as #695.
⚠️ These are first-execution results on tests that have never run. Some may be stale test expectations rather than engine defects — they need triage, not assumption. I have triaged the most serious one below and it does look like an engine defect. The others are reported as-found.
Results — --filter "…ChaosStressTests" excluding CreateDeleteRecreate/UltimateStress/Torture
| Test | Runs failed | Symptom |
|---|---|---|
CrossEntityTransaction_AtomicMultiUpdate |
3/3 | conserved sum violated — see below |
AllowMultipleIndex_HighChurn |
3/3 | Entity expected B=200085 got 300084 |
IndexSplit_CascadingSplitsUnderContention |
3/3 | Global verify: B=50194 entity has wrong B field: 30198 |
RollbackStress_ConcurrentRollbacks |
3/3 | Entity 48: Value 1201 != expected 4801 |
UniqueIndexViolation_UnderLoad |
3/3 | Winner B=32 has wrong B field: 28 |
Scale_4T_500E |
2/3 | Entity(Key=19, Arch=1) not found in PK index for CompA @ Transaction.ECS.cs:1247 |
The durability-specific tests in the same fixture all PASS — DurabilityRestart_DataSurvivesReopen, Checkpoint_ConcurrentWithHeavyWrites, DurabilityModes_MixedModesUnderLoad, PageCachePressure_ManyEntitiesSmallCache. The failures cluster on concurrent value correctness and indexes, not on durability.
The one I triaged: CrossEntityTransaction_AtomicMultiUpdate
A transfer workload: 6 threads × 50 transfers, each moving 1 unit from one entity to another inside a single transaction, with a delta-rebase ConcurrencyConflictHandler. The invariant is conservation — the total is unchanged.
Final sum mismatch: 20001 != 20000 after 282 transfers, 35 conflicts, 2 bad deltas, 2 errors.
Mismatches: e4: actual=1003(d=3) expected=1000(d=0) diff=3,
e11: actual=1004(d=4) expected=1005(d=5) diff=-1,
e12: actual=1001(d=1) expected=1002(d=2) diff=-1
Two independent signals point at the engine rather than the test:
e4gained 3 units that no successful transfer accounts for (expected d=0). Units were created, not merely misattributed — the total is+1.2 bad deltas— that counter is the test's own instrumentation inside the conflict handler:Every transfer writes exactly ±1, so within one entityvar delta = m.A - r.A; // committing minus read, same entity if (delta != 1 && delta != -1) { badDelta++; }
committing - readmust be ±1. It firing means the engine handed the handler a(ReadData, CommittingData)pair that do not correspond — e.g. the wrong entity's snapshot, or a read snapshot that moved under the transaction.
That is a conflict-resolution/rebase defect in the commit path, and it violates atomicity, not durability. Plausibly the same family as the ECS-5 / ECS-6 commit-path races on the H (hygiene) track of claude/design/Durability/MinimalWal/README.md:106, which was never started.
Reproduction
git checkout epic-411
dotnet test test/Typhon.Engine.Tests/Typhon.Engine.Tests.csproj -c Debug --no-build \
--filter "FullyQualifiedName~ChaosStressTests&FullyQualifiedName!~CreateDeleteRecreate&FullyQualifiedName!~UltimateStress&FullyQualifiedName!~Torture"
Why this went unseen — worth fixing independently of the bugs
bench/aws/shards.json shard [3] explicitly lists Typhon.Engine.Tests.ChaosStressTests in its classes array, and its filter selects it. So CI allocated a slot and a time budget to this fixture, ran 0 of its tests because of the [Ignore], and reported green.
Suggested guards:
-
[Ignore]should never be used to mean "long-running" — that is[Explicit]. Consider a test/lint that rejects fixture-level[Ignore]without an issue reference. - A shard that resolves to 0 tests for a class it names should fail, not pass silently.
Suggested next steps
- Triage each of the 5 as engine-defect vs stale-expectation; open a focused issue per confirmed defect.
-
CrossEntityTransaction_AtomicMultiUpdatefirst — it is an atomicity violation with a reproducible, self-instrumented signal. - Decide where these run once green (nightly
[Explicit]selection is the natural home, and shard 3 already believes it does this).
Related: #695 (livelock in the same fixture), #679 (OLC B+Tree concurrency — three of the failures above are index-related), Epic #411.
🤖 #411 reassessment — claude/research/Durability/epic-411-reassessment/.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Estimate
Area
Start date
Target date
Bug status
Product
Projects
- StatusShow more project fieldsDone
Activity
#712 #715 #711 #708 #695 Bug bash: eight defects, most of them silent…
nockawa commentedon Aug 8, 2026
Three of the five are not index failures
AllowMultipleIndex_HighChurn,IndexSplit_CascadingSplitsUnderContentionandUniqueIndexViolation_UnderLoadall report in the shapeB=50196 entity has wrong B field: 40156, and the issue groups them under "concurrent value correctness and indexes". The verification that produces that string does not touch an index:It opens by entity id. So the claim is that
Open(id).Read()serves another entity's data — a different and worse defect than a stale index entry.The cheaper explanation, ruled out first
Spawnhanding the same id to two entities would produce the identical symptom via the test's ownConcurrentDictionary. PR #721 builds the reverse map and reports duplicates before the value check, so a failure now says which of the two it is.Measured,
IndexSplit_CascadingSplitsUnderContentiononmain, Debug:Contiguous entity keys resolving to contiguous wrong values, offset by a constant, from another thread's range. Not a lost update (the values are coherent, just someone else's) and not a stale index entry (no index was consulted). It is a block of surviving entities whose records resolve to slots now holding other entities' data.
The workload that produces it is phase 2 — destroy every third entity and immediately respawn, on several threads at once.
Direction, stated as a direction
Slot reuse across a concurrent destroy, which is the neighbourhood of #582 face 1:
ReleaseSlotfrees a chunk with nothing excluding a concurrent reader or claimant. The contiguity could equally come from a swap-with-last compaction moving a survivor without updating its record. I have not traced it and am not claiming a root cause.What changes is the starting point. The next pass begins from "entity resolution returns another entity's data, ids are distinct, blocks are contiguous, cross-thread" rather than from three index-shaped error strings and a wrong subsystem.
The other two (
CrossEntityTransaction_AtomicMultiUpdate,RollbackStress_ConcurrentRollbacks) are untouched and still reproduce deterministically — the conserved-sum one at 19997 != 20000 with 3 bad deltas, matching the issue's own triage.🤖 Bug-bash round three (PR #721).
#703 Reject a suppression that cites what the same change closes
#703 Reject a suppression that cites what the same change closes (#725)
nockawa commentedon Aug 14, 2026
ChaosTest_MultiThreadedCRUDquarantined (5aa4803) — its red band is wider than this issue recordsThis issue notes
Scale_4T_500Efailing 2 runs of 3. Running the fixture on unmodifiedmaintoday, the band is wider and the victim moves:ChaosTest_MultiThreadedCRUDcasesHeavyWrite_4T_200E_WithDeleteLight_2T_50E_NoDelete,Medium_4T_100E_WithDelete,Scale_4T_500E,HeavyWrite_4T_200E_WithDeleteBetween one and four of the six cases fail per run, with a different subset each time. The seven tests already quarantined against this issue fail on every run by contrast — so this is a second, nondeterministic face of the same concurrent value/index correctness family, not the same failure.
Quarantined at the method rather than case by case, because the victim moves and per-case suppression would chase it.
QUARANTINE.mdrow added.Worth noting why it went unrecorded for so long: the fixture is
[Explicit], so the merge gate never selects it and these failures only appear when someone runs it by hand. Marking the category does not change what the gate runs — it makes the known-red state declared rather than rediscovered, and puts the test in the list that gets revisited when this issue closes.Two more reds seen on the same box, not part of this fixture
While running the full suite repeatedly today (4 runs), two unrelated tests failed once each with different victims — consistent with the #720 flake band, but both have concrete evidence worth recording:
Transient_SpawnDestroy_Throughput—IndexOutOfRangeExceptionatArchetypeClusterState.NoteClusterBorn(ArchetypeClusterState.cs:602) viaClaimSlot. That is the cluster-visibility fold added in A pull View held by user code is frozen until someone calls Refresh, while the incremental variant of the same call is live #722 / PR #722 #668 The cluster visibility summary latched permanently, and its watermark had to be published before the bit #795, whose own commit message warns that "a fold must also re-read the array reference after its CAS". This looks like exactly that hazard firing.TickFenceSingleVersion_LosesValuesButKeepsEntities_AcrossAHardCrash_SvPlusTransient_GroupCommit_None_Crash— 63 of 64 entities survived the crash where all 64 must.Neither is caused by the fence work on
feature/bug-bash(which touches only per-chunk buffer sizing). Flagging the first in particular, since it has a stack trace pointing at recently-merged code.#792 #803 #696 #802 Four bug-bash fixes, and three performance issues…
nockawa commentedon Oct 5, 2026
Bug bash 2026-10-05 — Fixed on branch
bug/696-chaos-stress-atomicity@ 60f0d91 (partial: 2 engine defects fixed; the rest triaged to other issues)Still live on main: yes. On
cca609b0(pinned 8 CPUs, 7 runs) the 7 quarantined tests fail 7/7, apart from IndexSplit at 6/7.ChaosTest_MultiThreadedCRUDfails 1–6 runs of 7 depending on the case. The fixture also hung until the 300 s timeout twice on main; the test was not identified (0 hangs in 6--blame-hangruns on the branch).Repro (deterministic, single thread; fail on main, pass on the branch):
TransactionTests.Rollback_Updated_ThenDisposedAfterAnotherWrite_DoesNotFreeThatWritesChunkTransactionTests.Rollback_Created_ThenDisposedAfterAnotherSpawn_DoesNotFreeThatSpawnsChunkTransactionTests.Rollback_Updated_OfANonLastRevision_KeepsTheLaterCommitFour more guard the fix, each checked against a mutant: trailing-void trim, compaction before rollback, LCRI not on a void, and an expired-deadline rollback that must wait.
Root cause 1: a rollback frees its chunks twice, so two entities end up sharing one payload. This is the "wrong B field" / "Value 902 != expected 501" family.
ALLOC (T24 write) → FREE (T24 RollbackComponent) → ALLOC (T21 write) → FREE (T24 CleanupEcsState ← Reset ← TransactionChain.Remove) → ALLOC (T10 write).Disposerolls back (EnsureCompleted), andRollbackComponentfrees the copy-on-write or spawn chunk (Transaction.cs:1488-1491).FreeChunksilently ignores a clear bit (ChunkBasedSegment.cs:750-754), so a single thread never sees it. It bites whenever another write takes the chunk between the two frees.Root cause 2: rolling back a revision that is not the last one drops the chain's last entry.
ComponentRevision.VoidElementdoes--ItemCount, unconditionally and without the lock.T1 write, T2 write+commit, T1 rollbackreads the value from before T2.Fix:
RollbackComponentis the only code that frees these chunks (branch L1467):CleanupEcsStateno longer frees any Versioned chunk and asserts it never resets anInProgresstransaction.VoidElementvoids the entry, then trims trailing voids, all of them. A trailing void would make cleanup free the committed sentinel.RollbackComponentvoids under the chain's exclusive lock with an unbounded wait. This is the rollback half of A conflict without a handler, and a rollback, void a revision entry by a stale position without the chain lock #1161; its conflict-path half is untouched.IsOwnPendingEntry).Effect on the fixture (8 CPUs). Columns: main (7 runs); branch (8 runs); branch plus #1158's publish fix from
fix/1151-1158-1159-coherence(7 runs). The #1158 fix was applied as an experiment and not committed.The conserved-sum test: its remaining cause is #1146, not fixed here.
EcsVersionedCopyOnWritere-walks the chain at the first Write (Transaction.ECS.cs:1616-1626).ReadCommitSequencealready counts it and first-committer-wins passes.ReadDatais tW's value while the user's value came from 100: that is the test's "bad delta".AllocateTSN()after Append), the bad deltas dropped to 0.RevisionChainLockTimeout. These are the runs that take 5 s and theerrorscount. A canonical lock order in PREPARE would remove them.Not fixed, evidence only:
Review (/code-review, one reviewer):
IsOwnPendingEntry, and the chunk is freed only once the entry is found.Transaction.ECS.cs:3519-3523, pre-existing).Gate:
pre-push.shfull green.ClusterThrottleBudgetTests.RelocationsSurviveATickThatAlsoCarriesCellCrossings(a 5 ms wall-clock budget under 8 concurrent shards; recovered on retry).Open:
rules/has no revision-chain / chunk-ownership module (README listsdata-engine.mdas unbuilt), so no[VerifiesRule].Transaction.csis also edited byfix/1151-1158-1159-coherence(inPublishComponent, a different method). Expect a textual merge, no semantic conflict.#696 Five ChaosStressTests leave quarantine: their causes are fixed o…
nockawa commentedon Oct 12, 2026
Bug bash 2026-10-12 — both engine defects fixed on main; branch now only un-quarantines (
bug/696-chaos-stress-atomicity@ 8eb9504)CleanupEcsStateskips entries the rollback already freed). TheVoidElementItemCount bug and the void under the chain lock are CHAIN-01 (VoidOwnPendingEntry/VoidEntry, #1146 #945 Plan 06: MVCC option C for all six families, crash recovery larger than the cache, and the defects found on the way #1319). Main's tests cover all of it:VersionedVoidRaceTests.ARollback_AfterANewerCommit_KeepsThatCommit,TwoRollbacksInReverseOrder…,ACompactionBeforeARollbacksVoid…, and the REAP-02 verifiers.f83ec312, 5 full runs on 8 CPUs + 6 runs on 4 CPUs (DOTNET_PROCESSOR_COUNT=4):ChaosTest_MultiThreadedCRUD(all 6 cases),RollbackStress,IndexSplit,AllowMultipleIndex_HighChurnandCreateDeleteRecreatepassed 11/11. They are no longer quarantined.UniqueIndexViolation_UnderLoadfails 6/6 alone. It is now under Two transactions putting one unique key concurrently both pass the pre-append check; the later publish fails past its append #1258: a unique collision at publish, past the append, stops the engine.UltimateStressfails 3/5 and hangs 2/5. Cause:RemoveElementLatchedreports "pessimistic descent made no progress in 200 retries" (IXW-01, Sliced and serial Prep disagree about ~2 000 crossings in about 1 run in 50 at eight workers #946's residual) past the append, the engine stops, and the rest is back-pressure.CrossEntity: the conserved sum now holds (MVCC: a reader's first read misses a revision its own snapshot should include — reproduced 13/500 on 4 vCPUs #1146). It still fails 1–2 runs in 6, with 5 sRevisionChain/GetElement|Enumeratelock timeouts. Probably handler commits retaining chain locks in write order (crossed pairs wait out each other's 5 s timeout), but that is not proven.[Explicit]fixture. Policy checks green.#1163 #978 #1164 #946 #1056 #1006 #1165 #1166 #841 #1168 Bug bash rou…
#1516 #1509 #879 #398 #1306 #1304 #1179 #1376 #1209 #908 #1365 #1210 #…