Skip to content

fix(ci): clippy sort_by_key, overlay.rs unused variable#2

Merged
millsydotdev merged 15 commits into
mainfrom
wave-17.2-fix
Jul 1, 2026
Merged

fix(ci): clippy sort_by_key, overlay.rs unused variable#2
millsydotdev merged 15 commits into
mainfrom
wave-17.2-fix

Conversation

@millsydotdev

Copy link
Copy Markdown
Owner

Fixes two CI failures identified in PR #1:

  • clippy: sort_by -> sort_by_key in event.rs
  • unused variable warning in overlay.rs (non-windows)

…tion, asset hardening

Complete three runtime integrity tasks:

Task 1 — Suspension system completion:
- Zstd snapshot compression with magic-byte detection for backward compat
- Performance benchmark test verifies <500ms suspend, <1000ms resume targets
- 3 new regression tests (compressed roundtrip, size comparison, perf)

Task 2 — SDK panic elimination:
- Removed 5 expect("storage lock") calls via mutex recovery helper
- Removed 3 expect("rng lock") calls via mutex recovery helper
- All SDK functions now recover gracefully from mutex poison

Task 3 — Asset pipeline hardening:
- Replaced expect("texture_loader lock") with mutex recovery
- Replaced 12 expect("cache lock") calls with recovery helpers
- Added lock_entries/lock_id_map helpers for consistent mutex handling

All 79 tests pass. cargo fmt, clippy -D warnings clean.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@millsydotdev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c2eb251c-d832-46bd-82e0-6960bd2a2005

📥 Commits

Reviewing files that changed from the base of the PR and between e05266a and 83d91c0.

📒 Files selected for processing (116)
  • CHANGELOG.md
  • Cargo.toml
  • crates/vibege-asset/Cargo.toml
  • crates/vibege-asset/src/cache.rs
  • crates/vibege-asset/src/handle.rs
  • crates/vibege-asset/src/lib.rs
  • crates/vibege-asset/src/loader.rs
  • crates/vibege-asset/src/metadata.rs
  • crates/vibege-asset/src/package.rs
  • crates/vibege-asset/src/statistics.rs
  • crates/vibege-asset/src/types.rs
  • crates/vibege-audio/Cargo.toml
  • crates/vibege-audio/src/engine.rs
  • crates/vibege-audio/src/handle.rs
  • crates/vibege-audio/src/lib.rs
  • crates/vibege-audio/src/mixer.rs
  • crates/vibege-audio/src/sound_cache.rs
  • crates/vibege-config/Cargo.toml
  • crates/vibege-config/src/config/audio.rs
  • crates/vibege-config/src/config/developer.rs
  • crates/vibege-config/src/config/graphics.rs
  • crates/vibege-config/src/config/input.rs
  • crates/vibege-config/src/config/mod.rs
  • crates/vibege-config/src/handle.rs
  • crates/vibege-config/src/lib.rs
  • crates/vibege-config/src/migration.rs
  • crates/vibege-config/src/profile.rs
  • crates/vibege-config/src/validation.rs
  • crates/vibege-config/tests/integration.rs
  • crates/vibege-core/src/diagnostics.rs
  • crates/vibege-core/src/error.rs
  • crates/vibege-core/src/event.rs
  • crates/vibege-core/src/lib.rs
  • crates/vibege-core/src/lifecycle.rs
  • crates/vibege-core/src/metrics.rs
  • crates/vibege-core/src/services.rs
  • crates/vibege-core/src/state_machine.rs
  • crates/vibege-input/Cargo.toml
  • crates/vibege-input/src/action.rs
  • crates/vibege-input/src/context.rs
  • crates/vibege-input/src/gamepad.rs
  • crates/vibege-input/src/lib.rs
  • crates/vibege-input/src/mouse.rs
  • crates/vibege-ipc/Cargo.toml
  • crates/vibege-ipc/src/lib.rs
  • crates/vibege-renderer/Cargo.toml
  • crates/vibege-renderer/src/lib.rs
  • crates/vibege-runtime-app/Cargo.toml
  • crates/vibege-runtime-app/src/main.rs
  • crates/vibege-sandbox/Cargo.toml
  • crates/vibege-sandbox/src/lib.rs
  • crates/vibege-scene/Cargo.toml
  • crates/vibege-scene/src/lib.rs
  • crates/vibege-scene/src/library/collections.rs
  • crates/vibege-scene/src/library/history.rs
  • crates/vibege-scene/src/library/integrity.rs
  • crates/vibege-scene/src/library/manager.rs
  • crates/vibege-scene/src/library/mod.rs
  • crates/vibege-scene/src/library/models.rs
  • crates/vibege-scene/src/library/registry.rs
  • crates/vibege-scene/src/library/search.rs
  • crates/vibege-scene/src/library/updates.rs
  • crates/vibege-scene/src/runtime/context.rs
  • crates/vibege-scene/src/runtime/error.rs
  • crates/vibege-scene/src/runtime/lifecycle.rs
  • crates/vibege-scene/src/runtime/mod.rs
  • crates/vibege-scene/src/runtime/orchestrator.rs
  • crates/vibege-scene/src/runtime/session.rs
  • crates/vibege-scene/src/runtime/state.rs
  • crates/vibege-scene/src/runtime/validator.rs
  • crates/vibege-scene/src/scene/kind.rs
  • crates/vibege-scene/src/scene/manager.rs
  • crates/vibege-scene/src/scene/message.rs
  • crates/vibege-scene/src/scene/mod.rs
  • crates/vibege-scene/src/scene/state.rs
  • crates/vibege-scene/src/scene/tests.rs
  • crates/vibege-scene/src/scenes/error_scene.rs
  • crates/vibege-scene/src/scenes/first_run_scene.rs
  • crates/vibege-scene/src/scenes/game_manager.rs
  • crates/vibege-scene/src/scenes/game_scene.rs
  • crates/vibege-scene/src/scenes/home_scene.rs
  • crates/vibege-scene/src/scenes/library_scene.rs
  • crates/vibege-scene/src/scenes/mod.rs
  • crates/vibege-scene/src/scenes/settings_scene.rs
  • crates/vibege-scene/src/scenes/store_scene.rs
  • crates/vibege-scene/src/store/cache.rs
  • crates/vibege-scene/src/store/discovery.rs
  • crates/vibege-scene/src/store/download.rs
  • crates/vibege-scene/src/store/manager.rs
  • crates/vibege-scene/src/store/metadata.rs
  • crates/vibege-scene/src/store/mod.rs
  • crates/vibege-scene/src/store/models.rs
  • crates/vibege-scene/src/store/search.rs
  • crates/vibege-scene/src/ui_helper.rs
  • crates/vibege-sdk/Cargo.toml
  • crates/vibege-sdk/src/animation.rs
  • crates/vibege-sdk/src/assets.rs
  • crates/vibege-sdk/src/audio.rs
  • crates/vibege-sdk/src/debug.rs
  • crates/vibege-sdk/src/input.rs
  • crates/vibege-sdk/src/lib.rs
  • crates/vibege-sdk/src/math.rs
  • crates/vibege-sdk/src/render.rs
  • crates/vibege-sdk/src/runtime.rs
  • crates/vibege-sdk/src/save.rs
  • crates/vibege-sdk/src/scene.rs
  • crates/vibege-sdk/src/storage.rs
  • crates/vibege-sdk/src/util.rs
  • crates/vibege-suspension/Cargo.toml
  • crates/vibege-suspension/src/lib.rs
  • crates/vibege-tray/src/lib.rs
  • crates/vibege-window/Cargo.toml
  • crates/vibege-window/src/display.rs
  • crates/vibege-window/src/dpi.rs
  • crates/vibege-window/src/lib.rs
  • crates/vibege-window/src/overlay.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wave-17.2-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- collections.rs: 3 sort_by -> sort_by_key with Reverse
- history.rs: 1 sort_by -> sort_by_key with Reverse
- search.rs: 4 sort_by -> sort_by_key (1 ascending, 3 descending with Reverse)

fix(tests): add Linux any_thread support for winit EventLoop in scene tests
- Previously failed on Linux CI with 'EventLoop outside main thread' panic
Task 1 — Expanded SDK API surface:
- New SdkState struct with timing (delta_time, frame_count, game_time)
- Runtime module: 3 new Lua APIs (delta_time, frame_count, game_time)
- Utility module: 2 new logging levels (warn, error)
- Platform detection uses std::env::consts::OS (simpler, cross-platform)
- All timing updated per-frame via SdkState::tick()

Task 2 — Professional error model:
- Created lua_err() helper to reduce repeated .map_err(|e| e.to_string())
- Cleaner error propagation throughout all SDK modules
- Consistent error format across all 7 modules

Task 3 — Developer experience polish:
- SdkState shared across all modules (not duplicated state)
- GameManager passes sdk_state through to GameSession
- GameScene owns and manages SdkState lifecycle
- Removed unused imports and dead code
- Tests: 13 pass (7 RNG + 6 storage)
Task 1 — Expanded runtime module:
- SdkState: FPS tracking with 0.5s window, uptime, pause/debug state
- Runtime API: fps(), uptime(), set_paused(), is_paused(), set_debug(),
  is_debug(), architecture(), build_version(), engine_version()
- Frame timing: delta_time, frame_count, game_time all updated per tick

Task 2 — Professional math module (vibege.math):
- Types: vec2(x,y), rect(x,y,w,h), color(r,g,b,a)
- Utilities: clamp, lerp, inverse_lerp, remap, smoothstep, sign
- Rounding: round, floor, ceil, abs
- Geometry: distance, normalize, radians, degrees
- Extrema: min, max

Task 3 — Professional debug module (vibege.debug):
- Debug draw: draw_rect (outline+fill), draw_line (point series),
  draw_circle (segment approximation), draw_text
- Diagnostics: runtime_stats(), asset_stats()
- No stubs — all functions are fully implemented

13 SDK tests pass. fmt, clippy, build all clean.
Task 1 — Professional render module:
- Load textures from Lua via vibege.render.load_texture(key, data) -> width,height
- Unload textures via unload_texture(key)
- Draw sprites: draw_sprite(key, x, y, w, h)
- Draw sub-textures: draw_subtexture(key, x, y, w, h, u1, v1, u2, v2, r, g, b, a)
- Draw tinted: draw_tinted(key, x, y, w, h, r, g, b, a)
- Query: has_texture(key), measure_text(text, char_w) -> w, h
- Internal SdkTextureCache manages Lua-loaded texture handles

Task 2 — Professional asset module (vibege.assets):
- 10 functions: exists, is_loaded, metadata, size, asset_type,
  release, unload, enumerate, memory_usage, statistics

Task 3 — Renderer architecture:
- New SpriteSubtex DrawCmd variant with UV coords + tint color
- draw_sprite_subtex(), draw_sprite_tinted() renderer APIs
- Proper integration with existing texture slot manager
- No stubs — all 168 lines fully implement

20 renderer tests + 13 SDK tests pass. fmt, clippy, build all clean.
Task 1 — Scene & Camera module (vibege.scene):
- Camera state: position, zoom stored in SdkState
- API: screen_size(), camera_position(), set_camera_position(),
  camera_zoom(), set_camera_zoom(), world_to_screen(),
  screen_to_world(), viewport()

Task 2 — Animation module (vibege.animation):
- Tween engine: active tweens updated per-frame in SdkState::tick
- API: tween(id, duration, from, to, easing?), get_tween_value(),
  is_tween_done(), cancel_tween(), cancel_all_tweens(), tween_count()
- 6 easing functions: linear, quad in/out/in-out, cubic in/out

Task 3 — Persistence module (vibege.save):
- File-based saves with SHA256 integrity checksums
- Per-game isolated directories (./saves/<game_name>/)
- API: save(slot, data), load(slot), delete(slot), exists(slot),
  enumerate(), metadata(slot)
- Backward compatible with legacy saves without checksums

13 SDK tests pass. fmt, clippy, build all clean.
…SDK improvements

Solitaire:
- Full Klondike rules: Draw 1/3, waste, foundations, tableau
- Undo (500 steps), hints, auto-complete, restart
- Seeded shuffle via vibege.util.set_seed/random_int
- Save/resume via vibege.save module
- 5 themes (felt/walnut/midnight/modern/carbon), high contrast mode
- Card rendering with shadows, suit symbols, rank labels
- Drag-and-drop, double-click to foundation, keyboard shortcuts
- Win detection, score, timer, move counter
- Lua-native serialization for save data (no external deps)

SDK improvements driven by game development:
- InputManager: added is_mouse_button_released()
- SDK input: added is_mouse_released() Lua binding
- Live testing of all 11 SDK modules through game usage

71 tests pass. fmt, clippy, build all clean.
…anager

Library:
- Game details now show play time, last played (e.g. '3d ago'),
  and formatted duration (e.g. '1h 30m')
- Update indicator shown inline in game list
- Favourite star shown inline with name
- Added format_duration() and format_days_ago() helpers
- Better detail line: version, author, size, play time, plays

Download Manager:
- Added speed_bytes_per_sec, eta_secs, last_update to DownloadTask
- DownloadQueue::update_progress() calculates transfer speed and ETA
- Speed averaged over 0.5s window for stability

147 scene tests pass. fmt, clippy, build all clean.
…level, home scene sections, library grid/view/sort, download queue concurrent
@millsydotdev millsydotdev merged commit 83d91c0 into main Jul 1, 2026
2 of 6 checks passed
@millsydotdev millsydotdev deleted the wave-17.2-fix branch July 1, 2026 02:12
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