Skip to content

[repo-assist] Investigate #452: add regression tests for dynamic-path scheduler bug - #458

Merged
dsyme merged 1 commit into
mainfrom
repo-assist/investigate-issue-452-dynamic-scheduler-bug-c2625a32af993f79
Aug 25, 2026
Merged

[repo-assist] Investigate #452: add regression tests for dynamic-path scheduler bug#458
dsyme merged 1 commit into
mainfrom
repo-assist/investigate-issue-452-dynamic-scheduler-bug-c2625a32af993f79

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Investigates the "dynamic implementation" bug reported in #452 (final item duplicated when consuming an externally-produced IAsyncEnumerable<'T> wrapped in taskSeq/TaskSeq.map, observed inside Orleans grain activations running on a custom TaskScheduler).

Investigation performed

  • Built and ran the full test suite (5430 tests) cleanly under both the pinned SDK (10.0.111, via global.json roll-forward) and SDK 10.0.400 — no reproduction of the reported NotImplementedException / forced-dynamic-path compiler regression in this repo's own test project under either SDK.
  • Attempted to reproduce the duplicated-final-item bug via four independent standalone repro scripts (FSI, always using the dynamic path):
    • Basic taskSeq yield/consume — correct.
    • Custom external IAsyncEnumerable wrapped by taskSeq, consumed normally — correct.
    • Same, but consumed via a custom single-threaded TaskScheduler (mimicking Orleans' per-activation scheduler) — correct.
    • Same, but consumed via a custom SynchronizationContext with artificial async delays in MoveNextAsync — correct.
  • None of these attempts reproduced the reported duplication, consistent with the original reporter's own inability to produce a standalone repro.

What this PR adds

TaskSeq.Issue452.Tests.fs — two regression tests that wrap a hand-written external IAsyncEnumerable<int> (with MoveNextAsync completing via Task.Run, similar in shape to Orleans' grain extension) using TaskSeq.map and using a taskSeq { for .. in .. do yield .. } combinator, while running on a custom single-threaded TaskScheduler. Both tests currently pass (no duplication observed), so they are not marked skipped — they serve as a documented regression guard and investigation trail, capturing the closest offline approximation of the reported scenario.

Trade-offs / limitations

  • The bug could not be confirmed as a library defect; it may require Orleans' actual per-activation scheduler/pull-loop machinery to trigger, which cannot be replicated standalone.
  • The related SDK 10.0.400 "forced dynamic path + NotImplementedException" report also did not reproduce in this repo and, per a maintainer's (majocha) earlier comment on the issue, is more likely an F# compiler regression that should be reported to dotnet/fsharp rather than fixed here.

Test Status

  • dotnet build src/FSharp.Control.TaskSeq.sln -c Release — succeeded, 0 warnings/errors.
  • dotnet fantomas . --check — clean.
  • dotnet test src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj -c Release5432 passed, 2 skipped (pre-existing), 0 failed.

Related: #452

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

…item bug

Adds TaskSeq.Issue452.Tests.fs with two tests that wrap an externally
produced IAsyncEnumerable<'T> (via TaskSeq.map and via a
taskSeq { for .. in .. do yield .. } combinator) while running on a
custom single-threaded TaskScheduler, mirroring the shape of the
reported Orleans scenario in #452.

Both tests currently pass -- despite several deliberate attempts
(custom TaskScheduler, custom SynchronizationContext, artificial async
delays) the reported duplicated-final-item behaviour could not be
reproduced outside of Orleans' own per-activation scheduler. The tests
are kept as a regression guard and a documented investigation trail.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme
dsyme marked this pull request as ready for review August 24, 2026 21:19
@dsyme
dsyme merged commit 7d5ca2d into main Aug 25, 2026
12 checks passed
@dsyme
dsyme deleted the repo-assist/investigate-issue-452-dynamic-scheduler-bug-c2625a32af993f79 branch August 25, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant