Repository navigation
Follow-up #345: Playwright e2e + post-review hardening on ChunksPerWorker - #347
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #345 / PR #346 — closes the two remaining acceptance-criteria boxes (Playwright
/aggregatedebounce spec + post-Phase-C10-internal-data-api.md §9rewrite) and lands the actionable findings from a post-merge code review.What's in this PR
Closes the remaining #345 acceptance criteria
e2e/profiler-aggregate-debounce.spec.ts— new Playwright canary. Opens thewith-access-declarationstrace fixture, opens SystemDag via the View menu and reactivates the Profiler tab (so the TimeArea canvas is hit-testable), emits a 12-frame wheel burst, and asserts the post-burst/aggregatePOST count is< WHEEL_BURST_FRAMES. The assertion intentionally targets the decoupling (count not proportional to gesture frames), not an absolute consumer-hook count — adding new/aggregateconsumers won't silently weaken it.useProfilerViewStore.transient.test.ts— new unit testcross-panel viewRange subscribers do NOT fire during a transient-write burst. Subscribes before the burst, proves transient subscribers fire N times butviewRangesubscribers fire zero times mid-burst and exactly once after the debounce. This is the load-bearing fluidity invariant the refactor was built to establish.TimeArea.tsx— addeddata-testid="profiler-time-area-canvas"so the Playwright spec can locate the canvas reliably.TopSpansPanel.tsx— stale comment rewritten: the panel's stats no longer have an internal 150 ms debounce (that was removed in Workbench Profiler: time-window single-source-of-truth refactor (fluidity fix) #345 step 5); coalescing across pan/zoom bursts is handled upstream by the transient/committed slot split.Post-review hardening for the ChunksPerWorker knob (separate concern, bundled)
A post-merge code review surfaced two real bugs in the just-merged scheduler knob plus a couple of test-coverage gaps:
RuntimeSchedule.cs— validation rewritten. Previously rejected only<= 0fand!IsFinite. Now requireschunksPerWorker ∈ [1.0, 64.0]:int * float → (int) castoverflow path:(int)MathF.Round(WorkerCount × 1e10f)collapses toint.MinValue, thenMath.Max(1, MIN) = 1silently produces one chunk — the opposite of the user's intent.SystemDefinition.cs,SystemBuilder.cs— XML doc updated to reflect the new bounds and overflow rationale.TyphonRuntime.cs:54— stale[chunkIdx]comment on_partitionViewscorrected to[workerId]. The bug-prone naming the patch killed was still in the comments inviting the next reviewer to reintroduce it.Stronger tests around the per-worker pool indexing fix
The original fix in #345 patched two indexing sites (
_partitionViewsand_tierRangeViews) but only the first was end-to-end tested. The tier-filtered path (GetOrCreateTierRangeView) had no fixture; a regression would only have been caught by AntHill at runtime.TierDispatchTests.cs— newTierDispatch_ChunksPerWorker_VisitsAllTierEntitiesregression test. Spawns 8 Tier0 entities across 8 cells, runs withWorkerCount=2 + ChunksPerWorker=2(cap=4 chunks > 2 workers), asserts via HashSet equality that every entity is visited exactly once.ChunksPerWorkerTests.cs—Oversubscribed_AllEntitiesAreVisitedtightened from>= entityCounttoHashSet.SetEquals(catches double-visits that the old>=survived).WorkerCount1_TwoX_SingleWorkerHandlesBothChunks— the degenerate case where a single worker drains all chunks, regression-pinning the workerId vs chunkIndex distinction.TieRounding_BankersRound_ToEven— pinsMathF.Round's ToEven behaviour at2 × 1.25 = 2.5 → 2(not 3). If anyone later switches toMidpointRounding.AwayFromZero, this test surfaces the deliberate decision.ScheduleValidationTests.cs— 4 new tests for the tightened bounds:BelowOne_Throws,AboveUpperBound_Throws,AtBoundaries_Succeeds,PositiveInfinity_Throws.Companion docs change (separate repo — not in this PR)
claude/design/Apps/Workbench/10-internal-data-api.md §9has been rewritten on the local working tree to reflect the post-Phase-C shipped state (two-store split:useProfilerViewStoreowns viewport,useSelectionStoreowns stable dimensions). Theclaude/repo commit + push is pending and lives in a separate repository.Test plan
dotnet buildclean (engine + tests)dotnet test— 3605 / 3605 engine tests pass (33 skipped, unchanged from main)npx tsc --noEmitclean (TS strict)npx vitest run— 607 / 607 tests pass (+1 new subscription-fire test)ScheduleValidationTests+ 7ChunksPerWorkerTests+ 1 newTierDispatch_ChunksPerWorker_VisitsAllTierEntitiesnpx playwright test profiler-aggregate-debounce.spec.ts(needs/wb-dev startfirst)Closes the remaining #345 acceptance criteria.
🤖 Generated with Claude Code