Skip to content

runtime: clean up for #562 - #571

Merged
lalinsky merged 2 commits into
lalinsky:mainfrom
notxorand:562_cleanup
Jul 14, 2026
Merged

lalinsky merged 2 commits into
lalinsky:mainfrom
notxorand:562_cleanup

Conversation

@notxorand

Copy link
Copy Markdown
Contributor

this just addresses some left-overs from @lalinsky's review in #562

+ add include_main_ready parameter to checkAboutForWork to control main
  task inclusion
+ update callers to specify inclusion status
+ consolidate conditional checks in armSearcher for better readability
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 08572ec9-63bd-4c0d-9c83-26e04458ac8b

📥 Commits

Reviewing files that changed from the base of the PR and between 0bd1c67 and 70b9338.

📒 Files selected for processing (1)
  • src/runtime.zig
💤 Files with no reviewable changes (1)
  • src/runtime.zig

📝 Walkthrough

Walkthrough

Executor now explicitly controls whether main-task readiness participates in work checks, using different behavior for initial and pre-searcher checks. Runtime.armSearcher() consolidates its early-return predicate and explicitly checks for an empty idle mask.

Changes

Runtime scheduling

Layer / File(s) Summary
Work-check readiness gating
src/runtime.zig
Executor.run() and parkAndSearch() pass explicit main-readiness flags to checkAboutForWork(), which conditionally includes main-task readiness.
Searcher arming guard
src/runtime.zig
Runtime.armSearcher() combines idle-mask and searcher-count checks into one early-return predicate.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • lalinsky/zio#296: Modifies related runtime scheduling behavior around main-task readiness.
  • lalinsky/zio#562: Updates the same runtime work and searcher coordination paths.

Suggested reviewers: lalinsky

Poem

Main task ready, the loop decides,
Searchers wait on idle tides.
A flag now guides each work-check call,
One guard keeps the runtime tall.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the changeset: a small runtime cleanup tied to PR #562.
Description check ✅ Passed The description is related and accurately says this PR addresses leftover review comments from #562.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/runtime.zig (1)

567-593: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the readiness split.

The false call intentionally excludes main-task readiness after releasing the search token, while the earlier calls include it. Add a focused test that wakes the main task while the executor is parked and verifies it resumes without another queued task.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime.zig` around lines 567 - 593, Add focused regression coverage for
checkAboutForWork, specifically the false include_main_ready path reached after
releasing the search token. Park the executor, wake the main task without
enqueuing another task, and assert that the main task resumes; also preserve
coverage showing earlier readiness checks include the main task.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/runtime.zig`:
- Around line 567-593: Add focused regression coverage for checkAboutForWork,
specifically the false include_main_ready path reached after releasing the
search token. Park the executor, wake the main task without enqueuing another
task, and assert that the main task resumes; also preserve coverage showing
earlier readiness checks include the main task.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d86bab01-87db-4c12-9ea7-044e6ff370cc

📥 Commits

Reviewing files that changed from the base of the PR and between 641bc81 and 0bd1c67.

📒 Files selected for processing (1)
  • src/runtime.zig

@lalinsky

Copy link
Copy Markdown
Owner

thank you

@lalinsky
lalinsky merged commit da263fe into lalinsky:main Jul 14, 2026
26 checks passed
@notxorand
notxorand deleted the 562_cleanup branch July 14, 2026 07:52
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.

2 participants