Skip to content

Refactor runtime submission, production, and result handling - #44

Merged
Miskovy merged 2 commits into
mainfrom
refactor/runtime-ownership
Oct 31, 2026
Merged

Miskovy merged 2 commits into
mainfrom
refactor/runtime-ownership

Conversation

@Miskovy

@Miskovy Miskovy commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

Separate submission validation, input reconstruction, bounded range production, progress delivery, posting cleanup, and result validation into cohesive steps within their existing owners. Behavior and public APIs are preserved.

Motivation / related issue

Maintainer-requested implementation refactor for readability and maintainability.

What changed

  • Task, range, dispatch, worker, and credit state stay with their current owners. Two internal modules contain stateless failure/contract projections.
  • Preserve getter/callback checks, posting barriers, physical ownership, and Node/browser retirement differences.
  • Separate braces/method-spacing cleanup from structural changes in two commits. Documentation and script organization are preserved.

Remove unused ProductionClaim.exclusive and posting finish fields after checking implementation, tests, installed consumers, scripts, and benchmarks. Exclusivity remains in the reservation closure; the resolver remains local to its posting transaction. Consolidate duplicated message branches and result preparation.

Contract / API impact

  • None
  • Package contents

No changes to scheduling, admission, settlement, cancellation/deadlines, recovery, replacement, streams/order, credits, memory ownership, or shutdown. Existing owners retain their state; extracted modules contain pure validation/error projections. Exclusive drain/recovery-credit exchanges remain the most involved logic and stay with the dispatcher.

Starting-main versus candidate inventories match for source and declarations: Node 71 exports/17 values, browser 72 exports/18 values, including signatures and statistics fields. Of 60 existing declaration files, 56 are byte-identical; four internal owner declarations reflect private helpers and removed internal fields. Two internal modules are added. Public manifests, defaults, exports, and release artifacts are unchanged.

Testing

  • runtime:qualify passes on clean baseline and candidate: build, 478 contracts, public types, compatibility compiler, installed ESM/CommonJS/TypeScript consumers, release-tool tests, lint, formatting, docs, diff, standard R2 (162 histories/2,746 actions), and standard R3 (11 fresh processes). Reservation invariants enabled.
  • Exact node-floor.mjs checks, both API inventories, and public fixtures pass with TypeScript 7.0.2 and 6.0.3.
  • test:browser passes graph/type checks and all 96 native/Vite isolated/non-isolated cases in Chromium 156.0.8078.4.
  • CI: all ten Linux/Windows version cells and browser acceptance pass.

Existing focused dispatch benchmark, same environment, 4 workers, 512 partitions, 2 warmups, 7 retained samples; median wall milliseconds:

Configuration Main Refactor
Manual scalar 72.61 67.64
Range scalar, batch 1 71.92 76.69
Range scalar, batch 8 23.58 21.66
Range typed result, batch 8 23.45 22.23

No performance improvement is claimed. Existing observable-contract tests cover the extracted seams; no implementation-mirroring tests were added. Baseline and final checks have no product failures.

Platforms tested

Local: Fedora 44 x64, Node 24.22.1, runtime npm 11.19.1, pinned release CLI 11.19.0. CI: Linux/Windows x64 on Node 22.23.4, 24.22.1, 24.22.2, 26.12.1, and 26.13.0. macOS, ARM64, Firefox, and WebKit were not executed.

Documentation

No public contract changes; documentation and scripts are unchanged.

Checklist

  • Change is focused.
  • Existing observable-contract tests cover the changed seams; no behavior change is intended.
  • Public documentation changes are not applicable.
  • No unrelated refactor is included.
  • No sensitive information is included.
  • Focused before/after measurements are recorded; no performance improvement is claimed.

@Miskovy
Miskovy marked this pull request as ready for review October 31, 2026 14:22
@Miskovy
Miskovy merged commit 4d65209 into main Oct 31, 2026
22 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