Skip to content

refactor: replace FastNoise implementation with fastnoise-lite#110

Open
juyonLee00 wants to merge 1 commit into
utilForever:mainfrom
juyonLee00:refactor/juyonLee00/replace_fastnoise_lite
Open

refactor: replace FastNoise implementation with fastnoise-lite#110
juyonLee00 wants to merge 1 commit into
utilForever:mainfrom
juyonLee00:refactor/juyonLee00/replace_fastnoise_lite

Conversation

@juyonLee00
Copy link
Copy Markdown

@juyonLee00 juyonLee00 commented May 28, 2026

What

Replaces the legacy FastNoise implementation in bracket-noise with a compatibility wrapper backed by fastnoise-lite.

Why

The existing fastnoise.rs file was maintained directly by implementing custom noise algorithms.
This change reduces maintenance costs by delegating consistent noise generation to fastnoise-lite. Additionally, the existing wrapper API is retained.

Some existing variations are mapped to similar variations available in fastnoise-lite.

  • Simplex / SimplexFractal -> OpenSimplex2
  • Cubic / CubicFractal -> ValueCubic
  • RigidMulti -> Ridged
  • Billow -> PingPong
  • Natural cellular distance -> Hybrid

Some existing settings are retained for API compatibility even if fastnoise-lite does not provide a direct equivalent.

  • Interp is stored but not forwarded to fastnoise-lite.
  • cellular distance indices are stored but not forwarded to fastnoise-lite.
  • the public seed API remains u64, while fastnoise-lite uses i32, so very large seed values may be truncated.

WhiteNoise remains implemented locally because fastnoise-lite does not expose a direct WhiteNoise noise type.

The base frequency remains at 0.0 to maintain the previous bracket-noise initialization behavior.

Adds fastnoise-lite as a new dependency for bracket-noise.

closes #22

Checklist

Required

  • cargo check --all passes
  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings -A clippy::multiple-crate-versions passes
  • cargo test --all passes
  • I linked the related issue: Closes bracket-noise를 대체할 라이브러리 찾기 #22

Functional Validation

  • Behavior related to this change was verified locally (if applicable)
  • Rendering/backend behavior was verified when runtime code changed (if applicable)
  • Algorithm behavior (pathfinding/FOV/noise/random) was verified when affected (if applicable)
  • I added or updated tests for changed behavior (if applicable)

Configuration & Docs

  • User-facing docs were updated (README.md, ARCHITECTURE.md, or relevant manual pages, if applicable)
  • New dependencies/configuration are documented (if applicable)
  • No sensitive values or credentials were introduced

If Applicable

  • Security impact considered (run cargo audit locally if needed)
  • Breaking behavior changes are clearly described in this PR

Summary by CodeRabbit

  • Chores
    • Updated project dependencies with a new library addition.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e28c378f-0354-4664-b217-d1a416f723b8

📥 Commits

Reviewing files that changed from the base of the PR and between fe7bf77 and 520dd0a.

📒 Files selected for processing (2)
  • bracket-noise/Cargo.toml
  • bracket-noise/src/fastnoise.rs
📜 Recent review details
🔇 Additional comments (1)
bracket-noise/Cargo.toml (1)

19-19: Fix verification: fastnoise-lite = "1.1" needs crates.io version/API confirmation; security advisories check returned none.

  • Security advisories: GitHub GraphQL query for fastnoise-lite returned no securityVulnerabilities entries.
  • Crates.io versions: the crates.io API fetch/parsing failed (jq: Cannot iterate over null), so the existence of fastnoise-lite 1.1.0 and the presence of newer versions (beyond ^1.1 allowing <2.0.0) can’t be concluded from the current results.
  • The review request should be re-run with a working crates.io API parse (or a fallback endpoint) to list available versions and confirm 1.1.0 exists.

📝 Walkthrough

Walkthrough

The bracket-noise crate now declares a dependency on fastnoise-lite version 1.1. This single-line manifest change introduces the external noise generation library to replace direct implementation within the crate.

Changes

Dependency Addition

Layer / File(s) Summary
Add fastnoise-lite dependency
bracket-noise/Cargo.toml
The [dependencies] section now includes fastnoise-lite = "1.1" to provide noise generation functionality.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Poem

A rabbit hops through the crate today,
Discovering fastnoise-lite came to play,
No need to build what others have done,
One line of deps, and noise-building's fun! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing the FastNoise implementation with fastnoise-lite, which aligns with the primary objective of the PR.
Linked Issues check ✅ Passed The PR addresses issue #22 by adopting fastnoise-lite as a replacement library while preserving API compatibility, meeting the core requirement to find and implement a suitable alternative library.
Out of Scope Changes check ✅ Passed The only change is adding fastnoise-lite as a dependency in Cargo.toml, which is directly in scope for the refactoring objective to replace the FastNoise implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bracket-noise를 대체할 라이브러리 찾기

1 participant