this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

gemini code review, cargo toml changes

alice 349e8195 dc762185

+49 -2
+2
AGENTS.md
··· 124 124 - Added small docs and `#[must_use]` on relevant fns; marked a few helpers `const` where safe. 125 125 - Cargo metadata filled in to silence cargo_common_metadata; clippy now passes with `-D warnings` across all targets. 126 126 - Ran `cargo fmt`, `cargo clippy --all-targets --all-features -D warnings`, and `cargo test`: all green. 127 + - Conducted a full code review of the `tic80_rust` crate. Findings are positive; suggestions for minor refactorings have been logged in `docs/roadmap/todos_code_review.md` and a summary added to `docs/adr/codereviews/001.md`. 128 + - Performed a second code review. The summary is located at `docs/adr/codereviews/002_ai_review.md` and actionable suggestions are in `docs/roadmap/todos_from_ai_review.md`. 127 129 128 130 **Docs Index** 129 131 - Start here: `docs/README.md`
+3
docs/README.md
··· 7 7 - `docs/roadmap/gui_first.md`: Combined GUI-first kickoff + milestones for `winit + pixels` and `cls/pix`. 8 8 - `docs/roadmap/editor_livecoding.md`: Livecoding editor plan (TIC‑80 UI vibes): CODE + CONSOLE only. 9 9 - `docs/roadmap/todos_code_review.md`: Rolling TODOs from code review (high/medium/low priority) with checkboxes. 10 + - `docs/roadmap/todos_from_ai_review.md`: Rolling TODOs from AI code review (2025-08-27). 10 11 11 12 ## Specs 12 13 - `docs/specs/memory_map.md`: Canonical pointer to the root `MEMORY_MAP.md` and usage notes. ··· 30 31 - `docs/adr/0001-winit-pixels.md`: Windowing/presentation stack decision. 31 32 - `docs/adr/0002-mlua-lua54-compat.md`: Lua 5.4 choice (superseded). 32 33 - `docs/adr/0003-lua53-with-compat.md`: Lua 5.3 with 5.1/5.2 compatibility. 34 + - `docs/adr/codereviews/001.md`: Code review summary (2025-08-27). 35 + - `docs/adr/codereviews/002_ai_review.md`: AI-generated code review summary (2025-08-27). 33 36 34 37 Notes 35 38 - `MEMORY_MAP.md` at repo root remains the canonical reference for layout. Specs here link to it rather than duplicating.
+20
docs/adr/codereviews/002_ai_review.md
··· 1 + # Code Review Summary (AI Agent, 2025-08-27) 2 + 3 + This document contains the summary of a comprehensive code review performed by an AI agent on the `tic80_rust` crate. 4 + 5 + ## Overall Assessment 6 + 7 + The project is in excellent condition. It is built on a solid architectural foundation, follows exemplary documentation and testing practices, and demonstrates a clear focus on achieving parity with TIC-80's behavior. The code quality is consistently high. 8 + 9 + ## Key Strengths 10 + 11 + - **Documentation-First Culture:** The project's most significant asset is its comprehensive and well-maintained documentation, including a clear roadmap, detailed specifications, and diligent use of ADRs. 12 + - **Robust Testing Strategy:** The test suite is thorough, covering graphics, memory, the Lua API, and audio analysis. The use of deterministic frame hashing is particularly effective. 13 + - **High Code Quality:** The codebase is clean, idiomatic, and adheres to a strict linting policy. 14 + - **Focus on Parity:** The implementation shows careful attention to replicating TIC-80's specific behaviors, from VRAM memory layout to API semantics. 15 + 16 + ## Actionable Suggestions 17 + 18 + A short list of minor, non-critical suggestions for improvement has been compiled. There are **no high-priority issues** requiring immediate attention. The suggestions primarily focus on minor refactoring opportunities to reduce code duplication and enhance clarity. 19 + 20 + These suggestions have been logged in a separate document: `docs/roadmap/todos_from_ai_review.md`.
+22
docs/roadmap/todos_from_ai_review.md
··· 1 + # Code Review TODOs (from AI Review 2025-08-27) 2 + 3 + This is a prioritized list of actionable suggestions generated from the AI code review on 2025-08-27. The full summary can be found in `docs/adr/codereviews/002_ai_review.md`. 4 + 5 + ## Medium Priority 6 + 7 + - **[ ] [VQT] Consolidate VQT API implementation:** In `script/lua_runner.rs`, the 12 VQT-related Lua functions (`vqt`, `vqts`, `vqtr`, etc.) are implemented as separate closures. This creates significant code repetition. 8 + - **Suggestion:** Refactor this into a single helper function or macro that takes query parameters (e.g., bin, smoothing, raw, whitened) to dispatch to the correct buffer in `VQTState`. This would improve maintainability. 9 + 10 + - **[ ] [main] Refine `AudioState` struct:** The `AudioState` struct in `main.rs` has accumulated numerous fields for debugging and statistics (`fx_fft_acc_ns`, `last_pushed`, `ema_samples_per_tick`, etc.). 11 + - **Suggestion:** Group related statistics fields into dedicated sub-structs (e.g., `FxStats`, `RingBufferStats`). This would make `AudioState` cleaner and the associated logic more modular. 12 + 13 + ## Low Priority / Nitpicks 14 + 15 + - **[ ] [FFT/VQT] Clarify `get_global_*` pattern:** The use of `OnceLock` for the global `FFTState` and `VQTState` is a pragmatic solution for accessing audio data from single-threaded Lua callbacks. 16 + - **Suggestion:** Add a small comment to the `FFT_SHARED` and `VQT_SHARED` static declarations explaining *why* this pattern is used (e.g., "Global state for easy access from Lua callbacks, which don't easily accommodate passing user data through C boundaries."). 17 + 18 + - **[ ] [main] Redundant `help` check:** In `main.rs`, the `if args.help` block appears twice consecutively. The second instance is unreachable. 19 + - **Suggestion:** Remove the duplicate block. 20 + 21 + - **[ ] [docs] Add a diagram:** The documentation is excellent, but a high-level component diagram could enhance its accessibility. 22 + - **Suggestion:** Consider adding a simple Mermaid diagram to `docs/architecture/runtime.md` showing the interaction between the main components (`main loop`, `winit`, `pixels`, `cpal`, `ring buffer`, `FFT/VQT State`, `LuaRunner`).
+2 -2
tic80_rust/Cargo.toml
··· 2 2 name = "tic80_rust" 3 3 version = "0.1.0" 4 4 edition = "2021" 5 - description = "Rust rewrite subset of TIC-80: framebuffer, Lua bridge, memory, audio capture + FFT/VQT" 5 + description = "Rust rewrite subset of TIC-80, optimized for performance and livecoding" 6 6 license = "MIT" 7 - repository = "https://github.com/nesbox/TIC-80" 7 + repository = "https://github.com/aliceisjustplaying/rustic" 8 8 readme = "../README.md" 9 9 keywords = ["tic-80", "fantasy-console", "game", "graphics", "audio"] 10 10 categories = ["game-engines", "graphics", "multimedia::audio"]