Repository navigation
Highlights
opentui_rust v0.2.3 is a patch release with no breaking public API changes. It resolves a real UTF-8 slicing panic in Rgba::from_hex uncovered by restoring and running the fuzz suite, repairs benchmark driver exit-code and regression propagation, switches the release profile to opt-level = 3 for significant rendering speedups, resolves RUSTSEC-2026-0486, and clears all --all-targets --all-features clippy and rustdoc warnings.
Bug Fixes & Safety
- Fix UTF-8 panic in
Rgba::from_hex(src/color.rs): Replaced byte-offset&strslicing with byte-slice pattern matching and direct ASCII hex nibble decoding. Multi-byte UTF-8 inputs of 3, 6, or 8 bytes (such as"#中","日本","🎨🎨") now safely returnNoneinstead of panicking on a non-char boundary, and signed inputs like"+1+2+3"are rejected. - Fix fuzz crate package binding & targets (
fuzz/, closes #42): Addedpackage = "opentui_rust"under[dependencies.opentui]infuzz/Cargo.toml(preserving theopentuialias andpath = ".."), regeneratedfuzz/Cargo.lock, updatedfuzz_input_parser.rsto coverPasteBufferOverflow,InvalidResizeFormat, andSequenceTooLong, and guarded substring slicing infuzz_color_hex.rswithis_char_boundary. All three fuzz targets build cleanly withlibfuzzer-sysand pass bounded fuzz runs (fuzz_input_parser20,000 runs over retained seed corpus,fuzz_color_hex50,000 runs,fuzz_keyboard_parser20,000 runs; 0 crashes). - Fix benchmark driver failure & regression propagation (
scripts/bench.sh,scripts/benchmark_regression.sh,tests/e2e_perf.rs, closes #43):scripts/bench.sh: Captures real child and timeout (124) exit codes viaPIPESTATUS[0], passes--before Criterion baseline flags (--save-baseline/--baseline), detects Criterion regressions under--baseline, records overall status/exit code inbenchmark_summary.json, and exits nonzero on any failure, timeout, or regression.scripts/benchmark_regression.sh: Creates log directory before writing, fixes thegrep -c ... || echo "0"double-zero bug, parses benchmark output cleanly, preservescargo benchexit codes, and exits1when regressions are detected.tests/e2e_perf.rs: Classifies zero baselines and invalid thresholds asPerfStatus::InvalidBaseline(neverPass), returnsResult<PerfBaseline, String>fromload_baseline()so missing, unreadable, malformed, or zero-valued baseline files fail loudly without falling back to defaults, and adds 7 harness-integrity unit tests (leavingtests/baselines/perf_baseline.jsonintact).
Performance ([profile.release] opt-level = 3)
- Switched
[profile.release]fromopt-level = "z"toopt-level = 3(preservinglto = true,codegen-units = 1,panic = "abort",strip = true). - Paired same-host interleaved A/B benchmarks (20 rounds on
demo_showcaseheadless workloads, incumbentopt-level = "z"vsv0.2.3opt-level = 3):headless_smoke_80x24:2.99 ms -> 2.36 ms(-21.0%,1.27xfaster; A/A noise-5.4%)headless_smoke_200x60:5.66 ms -> 4.32 ms(-23.6%,1.31xfaster; A/A noise-4.0%)headless_dump_json_200x60:5.76 ms -> 4.45 ms(-22.9%,1.30xfaster; A/A noise-0.4%, byte-identical 1,097 B JSON output)headless_check_layout/headless_check_hitgrid: within A/A noise (+1.2%/-1.3%)- 60-benchmark Criterion suite (
workloads,buffer,renderer,color):-33.0%median latency, up to4.86xfaster (diff_reuse_80x24),4.83xfaster (color_from_hex),4.74xfaster (cell_get_full/200x60), and2.69xfaster (full_cycle_with_ansi_80x24), with 0 regressions beyond noise. - Stripped
demo_showcaserelease binary:577,760 B -> 666,760 B(+89 KB,651 KiB).
Dependencies & Security
- Updated
rustix1.1.4 -> 1.1.6to resolve RUSTSEC-2026-0486 (cargo audit: 0 vulnerabilities, 0 warnings for bothCargo.lockandfuzz/Cargo.lock). - Updated runtime transitive dependencies (
smallvec 1.16.6,tinyvec 1.13.3droppingtinyvec_macros 0.1.1) and Rust 1.85-compatible dev/build dependencies, alongside dependency bumps merged sincev0.2.2(unicode-width 0.2.3,unicode-normalization 0.1.26,libc 0.2.191,bitflags 2.13.2,insta 1.49.0,serde_json 1.0.154,vt100 0.18.1). - Kept
proptest 1.11.0to preserverust-version = "1.85".
Verification
cargo fmt --all -- --check&cargo fmt --manifest-path fuzz/Cargo.toml -- --check: cleancargo clippy --locked --all-targets --all-features -- -D warnings: clean (0 warnings)cargo test --locked --no-fail-fast: 2,411 passed, 0 failed, 14 ignored across 29 targetscargo test --locked --all-features --test visual_pty_test: 8 passed, 0 failedRUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps --all-features: cleancargo audit&cargo audit --file fuzz/Cargo.lock: 0 vulnerabilities, 0 warningsshellcheck -S warning scripts/bench.sh scripts/benchmark_regression.sh: clean
Full Changelog: v0.2.2...v0.2.3