Skip to content

chore: check formatting in CI, and stop pacing failures being UB - #135

Merged
meszmate merged 2 commits into
mainfrom
chore/ci-fmt-and-pacing-safety
Aug 14, 2026
Merged

chore: check formatting in CI, and stop pacing failures being UB#135
meszmate merged 2 commits into
mainfrom
chore/ci-fmt-and-pacing-safety

Conversation

@meszmate

Copy link
Copy Markdown
Owner

Small cleanups from the codebase review.

zig fmt in CI

Formatting was never enforced, and eight files had drifted (tests/unicode_tests.zig and seven examples). CI now runs zig fmt --check src tests examples build.zig, and those files are formatted — the whole diff outside the workflow is 52 lines of whitespace.

catch unreachable on the frame-pacing wait

deadline.wait(self.io) catch unreachable;

A wait can fail — a cancelled or interrupted sleep. unreachable on that path is undefined behaviour in a release build, and the only consequence of the failure is that one frame goes unpaced. It now continues instead.

Dead code

sleepNs had no callers.

zig build test and zig build clean on 0.16.0.

`zig fmt` was never enforced, and eight files had drifted. CI now runs
`zig fmt --check` over src, tests, examples and build.zig, and those
files are formatted.

Frame pacing used `catch unreachable` on the deadline wait. A wait can
fail -- a cancelled or interrupted sleep -- and `unreachable` on that
path is undefined behaviour in a release build, for something whose only
consequence is one unpaced frame. It now continues instead.

Removes `sleepNs`, which nothing called.
On a filesystem that cannot hold extended attributes -- exFAT, NTFS,
most network shares -- macOS writes a `._name` sidecar next to every
file it touches. They are metadata for files that are already tracked,
they appear in their thousands, and a `git add` of a directory sweeps
them straight into a commit.
@meszmate
meszmate merged commit b1e5aea into main Aug 14, 2026
10 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