com um clique
code-review
// Perform a project-wide code review of the 5thPlanet SEGA Saturn emulator, covering correctness, emulation accuracy, code quality, tests, documentation, and style.
// Perform a project-wide code review of the 5thPlanet SEGA Saturn emulator, covering correctness, emulation accuracy, code quality, tests, documentation, and style.
Audit and update all project documentation to stay in sync with the current development status of the 5thPlanet SEGA Saturn emulator.
Stage, commit, and (when a remote exists) push changes with a well-formed Conventional Commits message.
Manage the full software release process for the 5thPlanet workspace — version bumps, changelogs, Git tags, and (when applicable) GitHub releases.
Perform a project-wide security and safety audit of the 5thPlanet workspace.
| name | code-review |
| description | Perform a project-wide code review of the 5thPlanet SEGA Saturn emulator, covering correctness, emulation accuracy, code quality, tests, documentation, and style. |
When performing a project-wide code review, always follow these steps:
Survey recent changes — Run git log --oneline -20 and skim the corresponding diffs to understand the scope of work before examining individual files.
Security & safety — Apply the security-audit skill. Particular attention:
unsafe_code = "forbid" (in root Cargo.toml) must remain in place. Any new #![allow(unsafe_code)] requires justification.wrapping_* or explicit bounds, never raw indexing that could panic on hostile addresses.Emulation accuracy — The project's design axis is accuracy over performance. Review for:
SH7604 Hardware Manual §3 for pipeline interlocks). Hand-wavy "approximately N" cycles is a regression risk.Op::is_illegal_in_slot() is consulted for new branch/jump/SR-modifying ops.PC_of_instr + 4 as the base, not the running regs.pc. Verify new PC-relative ops use the instr_pc argument plumbed through execute().from_be_bytes/to_be_bytes.Correctness and logic — Review for:
unwrap() / expect() in non-test code where a meaningful error or exception could be raised instead.Pipeline::cycles uses saturating_add, new accumulators should too.Code smells — Flag:
Test coverage — Verify:
crates/sh2/tests/ (file per opcode family).pipeline_timing.rs assertion (once task #5 lands).crates/sh2/src/decoder.rs::tests case.MemBus fixture (sh2::harness); ad-hoc bus mocks duplicate it without need.Documentation quality — Confirm:
sh2 carry /// doc comments naming the SH-2 manual reference where relevant.doc/roadmap.md reflects the current milestone status (mark tasks ✅ done as soon as they land).Code style — Confirm:
cargo fmt-clean (no #[rustfmt::skip] without justification).cargo clippy --workspace --all-targets -- -D warnings is clean. Any #[allow(clippy::...)] suppression must have a comment explaining why the lint is a false positive here.println! / eprintln! in the sh2 library crate (it's no_std + alloc only).Report findings — Present all identified issues grouped by category: Safety, Accuracy, Correctness, Code Smell, Tests, Documentation, Style. Assign each a severity of Critical, High, Medium, or Low. For every finding, include the file path and line number, a clear description, and a concrete recommendation for how to fix it.