Skip to content

mapA/chooseA/reduceByA readers: register target before evaluating it - #125

Merged
krauthaufen merged 1 commit into
masterfrom
fix/mapa-register-before-eval
Nov 6, 2026
Merged

krauthaufen merged 1 commit into
masterfrom
fix/mapa-register-before-eval

Conversation

@krauthaufen

@krauthaufen krauthaufen commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

AList.mapA/chooseA, AMap.mapA/chooseA and the reduceByA readers registered a new element aval in targets only after GetValue. A transaction marking it in between calls InputChanged without the reader's lock, finds no entry, and the aval never becomes dirty: it stays OutOfDate for good and all later changes are lost.

Fix: register under lock cache / dirtyLock before evaluating. No new lock or lock order; cache remains a leaf lock.

ASet.mapA/chooseA/filterA/flattenA are not affected (AbstractDirtyReader).

Tests in MapARace.fs hit the window deterministically via a GetHashCode hook; all 7 fail before, pass after.

A transaction marking the new aval between GetValue and the targets
registration found no entry in InputChanged, so the aval never became
dirty and stayed OutOfDate for good.
@krauthaufen
krauthaufen merged commit 08a9e3b into master Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant