Test suite is not deterministic; one random Calc case differs from Emacs #204

closed cmc opened this on 2026-11-22 07:11 UTC · feature · milestone 1 Reviews and cleanup

Discussion

cmc 2026-11-22 07:11 UTC

Severity: Medium.

CalcTests.symbolicFunctionsMatchCalc uses a random seed unless ORGSTAR_SEED is set (Tests/OrgCoreTests/CalcTests.swift:451); unseeded generators are also at CalcTests.swift:272, :297, :314, :402, Tests/OrgEditorAppKitTests/LineIndexTests.swift:14, :37 and Tests/OrgCoreTests/ListItemScanTests.swift:11. One of four full runs failed: abs(vmin([(3 - uinf) ^ (-1)], [0. < (-1 > 2.5)])) (eng 2, p12, seed 13596949266880706848) gives 0 in orgstar and nan in Calc. Use fixed default seeds with a variable for random runs, and fix or refuse that expression.

From the performance review, docs/review-2026-11-21.md (#96).

Platforms: macOS, iOS (shared Calc); tests on macOS.

cmc 2026-11-22 13:14 UTC

AgendaModelTests.checksFilesOffTheMainActor (added in #196) is timing-relative: it requires the longest main-actor stall during a cache-hit refresh to be under half the refresh time. It failed in a full swift test run on the combined batch 3 code (Tests/OrgAppTests/AppTests.swift:623) and passed three times out of three when run alone. Under the full parallel suite the main actor competes with other tests, so the ratio does not hold. Either measure something that does not depend on load (for example assert that the stat loop does not run on the main thread), or run it serialised.

closed by cmc in commit d4de9df55d: Seed the random tests and refuse two Calc cases that diverge

2026-11-22 18:20 UTC

referenced in commit 415778652e by cmc: Compare the fastest of five rounds in the backlinks timing test

2026-11-22 19:30 UTC