feat: Noise Generation Wrapper Service - #20
Merged
Conversation
…ification for noise generation service
…oml, implement CLI for noise generation, and enhance main application structure
… Actions workflow
…d linting, implement Perlin noise generation, and create README and Docker Compose files
…rithms, update OpenAPI specification, and implement integration tests
…ithms, update Dockerfile dependencies, and implement integration tests
…algorithms support, usage examples, and deployment instructions
…ng to 8000, add development and production Docker Compose files, and streamline test command.
…ture, add tests for CLI parsing, and implement CI workflow for build and testing
… improve CLI usage instructions
…service and update port mapping in development setup
- Upgraded `clap` from version 3.2 to 4.5 in `Cargo.toml` for improved CLI functionality. - Added `Debug` trait to `Cli` and `Commands` structs for better debugging output. - Introduced new noise generation algorithms: `OpenSimplex` and `Worley`. - Refactored `generate_noise` function to streamline algorithm matching and response creation. - Updated `generate_cellular_noise` and `generate_opensimplex2_noise` functions to utilize new noise algorithms. - Adjusted tests to reflect changes in CLI structure and functionality.
…DME with setup instructions
…rvice - Updated `axum` to version 0.7.5 and `tokio` to version 1.36 in Cargo.toml. - Changed `clap` version to 4 and updated `fastnoise-lite` to 1.1.1. - Upgraded Rust base image in Dockerfile to 1.85-slim-bookworm. - Adjusted port mapping in docker-compose files for development (8000:8000) and production (8000:3000).
…nagement - Added UUID dependency to Cargo.toml for unique field identification. - Introduced AppState struct to manage shared state using Arc and Mutex. - Modified generate_noise function to create and store noise fields with unique IDs. - Updated get_noise function to retrieve noise fields by their unique IDs. - Enhanced integration tests to validate noise field generation and retrieval.
…te integration tests
…d update integration tests
…te integration test
… update integration tests
…meter support and update integration tests
…y field differences
…waiting for readiness
5 tasks
plc-dev
requested changes
Jul 20, 2026
…ove obsolete test script
…tate management, and enhance response validation - Removed unused CLI commands for retrieving noise fields and points. - Simplified state management by eliminating unnecessary AppState structure. - Updated noise generation logic to directly return results without state dependencies. - Enhanced integration tests to validate the new response structure, including id, status, algorithm, and data. - Added performance tests for medium and large grid generation. - Updated smoke tests to validate the complete response format for all algorithms.
…noise generation and integration tests
plc-dev
requested changes
Jul 22, 2026
plc-dev
requested changes
Jul 23, 2026
plc-dev
left a comment
Member
There was a problem hiding this comment.
After a closer look at the code, there's still a lot of structural issues, esp. regarding code quality and interface- as well as documentation-mismatches.
…cation - Replace algorithm/format String types with clap::ValueEnum enums - Align CLI with OpenAPI: --size, --params JSON, remove stale Png - Reduce duplication: fill_2d helpers, shared algorithm_name/size methods - Fix: random seed, normalize wired up, RidgedMultiParams persistence - No subcommand shows help (no implicit server start) - README: 14→15 algorithms, tests updated
…s via /v1/algorithms Three core changes to make noise field generation fully reproducible: ### 1. params_used in POST /v1/noise response (critical bug fix) - Add field to - Create enum resolved exactly once per request, used for BOTH generation and the response echo - Fix critical seed-mismatch bug: previously was called independently in AND , producing different random seeds when none was provided by the caller - Add default constants for jitter, strength, amplitude, blend_factor, utility_value (were previously hardcoded at multiple sites) ### 2. Default metadata via GET /v1/algorithms - Add struct with + - Return structured objects instead of plain string array - Add function using centralized DEFAULT_* constants - Proper OpenAPI schema: register in components(schemas) ### 3. Documentation and tests - README.md: document params_used, expanded /v1/algorithms response, explanation why parameters stay optional despite full traceability - CLI: update JSON/CSV output for new list format - 36 integration tests covering response structure, params_used per algorithm family, seed consistency, dimension support (1D/2D/3D), error cases, normalization, and rectangular grids
- Implement 4D loops in fill_noise_rs_4d, fill_cell_loops!, shape_data - Add white_noise_4d native hash function - Reject 4D for FNL-based algorithms, DomainWarp, and SuperSimplex - Reject 5D+ early in generate_noise - Update CLI to accept 4 values for --size - Fix README Algorithms Reference (remove stale sub-field docs) - Deduplicate resolve_params via resolve_seed_only/resolve_fractal helpers - Add comment explaining default 64x64 fallback
…rse Fixes - CLI-Flags auf API-JSON-Pfad gemappt: --sampling-size, --output-format, --output-normalize, --output-file (alte Aliase --size/--format/--normalize/--output bleiben als visible_alias erhalten) - Redundantes `Sampling.mode`-Feld entfernt (Dimensionalität wird aus size.len() abgeleitet) - YAML-Output via serde_yaml statt JSON (openapi --format yaml liefert nun echtes YAML) - CSV-Export lehnt 3D/4D-Daten explizit ab (Fehlermeldung + Exit-Code 1) - Code-Duplikation in generate_flat reduziert: fill_fnl_seed_only() + fill_fractal!-Makro - Manuelle Default-Impls durch #[derive(Default)] + #[default] ersetzt (CombinatorOp, UtilityKind, OutputFormat) - Clippy-Warnings gefixt (map_or → is_some_and, manual_range_contains) - Tests an neue Feldnamen angepasst, README aktualisiert
…utput from every enum variant
Break GenerateNoiseRequest from a 15-arm tagged enum into a struct
with #[serde(flatten)] algorithm: AlgorithmParams, plus top-level
sampling and output fields. AlgorithmParams uses #[serde(tag =
"algorithm", content = "params")] to preserve the exact same
adjacently-tagged JSON wire format.
Benefits:
- sampling_size() and should_normalize() drop from 17 lines each
(15-arm or-pattern match) to trivial 1-line field access
- algorithm_name() and check_dimension_support() now match over
AlgorithmParams instead of GenerateNoiseRequest — same logic,
cleaner base
- handle_generate_command() in main.rs builds 'output' once instead
of cloning it in all 15 match arms
- 46 lines of net code removed
Verification:
- cargo build + cargo clippy: clean
- cargo test: all 60 tests pass (unit, CLI, integration)
- Serialization tests confirm the wire format is byte-identical:
{ "algorithm": "perlin", "params": {...}, "sampling": {...},
"output": {...} }
- All 15 algorithms produce identical numerical results for the same
seed/params
plc-dev
approved these changes
Jul 26, 2026
…ion-wrapper-service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds noise-generation-wrapper-service for issue #9.
The service wraps the fastnoise-lite and noise_rs Rust libraries into a unified REST API and exposes OpenAPI, CLI, Docker, tests, and CI support. It runs fully self-contained — no external credentials, API keys, or cloud dependencies required.