szn

szn v0.8.1

23 commits since v0.8.0. 870 tests passing.


Headline: Reliability Hardening and Zig 0.16 Compliance

v0.8.1 is a patch release that closes out the remaining bug tracker entries (#300–#346) and brings the codebase into full Zig 0.16 compliance. The highest-impact fixes are performance (O(n²) → O(1) hot-path caches), memory safety (UAF, double-free, leaks eliminated), and error handling (91 silent catch {} suppressions replaced with proper logging).


Performance: O(n) → O(1) Hot-Path Caches

The v0.8.0 performance audit (#300–#310) identified 11 bottlenecks in the render and event loops. All have been resolved with targeted caching:


Memory Safety: UAF, Double-Free, and Leak Fixes

Bug Fix
#312 processInput UAF when an action destroys the active pane or session — added guard
#313 Window title callback called allocator.free on a Session arena pointer
#314 Border format strings allocated with wrong allocator (pane grid vs gpa)
#324 cmdRenameWindow leaked window name into session arena
#338 Status line string duplicated per frame when cache hit — removed redundant allocation
#315/#320/#323 Command/layout desync on pane removal — layout tree and pane list kept in sync
#316/#317 Sixel refcount leaks on vertical screen shrink and history eviction
#318 Layout split failure left parent pane dimensions un-restored
#319 Darwin errno enum check; window name stack pointer fixup; invalid free
#321 Uncapped loop in CSI ‘Z’ handler — CPU exhaustion DoS
#322 Synchronous blocking write in server response dispatch

Bug Fixes

Parser & Configuration (#325, #326, #327, #328, #329, #330, #334)

Grid & Rendering (#311, #316, #317, #318, #321, #322)

Server & Dispatch (#312, #315, #319, #320, #323, #325, #335, #336, #337)

Key Binding & Format (#326, #327, #328, #329, #330, #331, #332, #333, #334)


Zig 0.16 Compliance

Bug Fix
#339 91 instances of catch {} replaced with catch |err| std.log.warn(...) across 9 files
#343 detectNested() in main.zig now uses init.environ_map instead of std.c.getenv
#344 main() signature changed from void to !void (Zig 0.16 rule #1)
#345 std.process.Args.Iterator replaced with init.minimal.args.toSlice(arena) — eliminates N heap allocations per invocation
#341 initCapacity() calls updated to = .empty + ensureTotalCapacity for consistency

Three items initially flagged as violations (#340, #342, #346) were verified against the actual Zig 0.16 std lib source and confirmed as false positives:


Bug Tracker Status

Metric v0.8.0 v0.8.1
Total bugs 300 346
Fixed 286 327
False positive 9 17
Intentional 1 1
Open 0 0

All 346 bugs are now resolved.


Testing

Metric v0.8.0 v0.8.1
Passing tests 802 870
New regression tests — 68