Skip to content

Fix thumb assembly - #257

Merged
lalinsky merged 2 commits into
mainfrom
fix-thumb-assembly
Jan 29, 2026
Merged

lalinsky merged 2 commits into
mainfrom
fix-thumb-assembly

Conversation

@lalinsky

Copy link
Copy Markdown
Owner

No description provided.

Shows real-time progress with test name and completion count in non-verbose mode.
Long test names are truncated to show the last 40 characters (most specific part).
Failed tests display error details immediately while progress continues.
@coderabbitai

coderabbitai Bot commented Jan 29, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR reorganizes C standard library linking in build.zig by moving linkLibC() calls from module declaration to individual executables and libraries, splits ARM/Thumb context-switch assembly into separate code paths, adds freestanding environment support to stack page sizing, and enhances test progress reporting with pre-counted tests and consolidated error output.

Changes

Cohort / File(s) Summary
Build Configuration
build.zig
Removed .link_libc = true from the zio module declaration and instead call linkLibC() explicitly on each example executable, benchmark executable, and the unit test library.
Coroutine Assembly
src/coro/coroutines.zig
Split combined .arm, .thumb assembly blocks in switchContext and coroEntry into separate dedicated code paths, with ARM performing minimal register loads/branches and Thumb implementing Thumb-specific return-address handling and context preservation.
Stack Utilities
src/coro/stack.zig
Made page_size constant conditional: returns 1 in freestanding mode, otherwise uses std.heap.page_size_min.
Test Infrastructure
test_runner.zig
Added pre-pass test counting and live progress tracking via std.Progress, displaying test index and truncated test names; consolidated non-verbose error reporting into a single block after test execution; removed per-test status lines printed immediately after each result.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • #256: Directly mirrors the test progress tracking changes in test_runner.zig, including pre-counting tests and live progress display.
  • #176: Adds coro_tests target with explicit libc linking, overlapping the build.zig refactor approach.
  • #138: Modifies ARM/AArch64 coroutine context-switch implementation, directly relevant to the assembly refactoring.

Poem

The linker now calls out with clarity,
Assembly splits its paths without rarity,
Stacks measure themselves by mode,
Tests march forth with progress showed,
Less chaos, more light on the road. 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description explaining the Thumb assembly fixes, their motivation, and impact on ARM/Thumb context switching.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main change: fixes to Thumb assembly in coroutines.zig, which represents the most substantial and focused modification in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-thumb-assembly

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 and usage tips.

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