refactor: flatten native Rust package

This commit is contained in:
Dandaedre 2026-10-06 19:27:37 +02:00
parent 26a179fee7
commit 3522a4abb8
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
25 changed files with 34 additions and 82 deletions

View File

@ -1,68 +0,0 @@
name: Native release
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: balatro-seed-search-linux-x86_64
binary: balatro-seed-search
- os: macos-14
artifact: balatro-seed-search-macos-aarch64
binary: balatro-seed-search
- os: windows-latest
artifact: balatro-seed-search-windows-x86_64
binary: balatro-seed-search.exe
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: engine
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Test
run: cargo test --release --all-targets --locked
- name: Lint
run: cargo clippy --all-targets --locked -- -D warnings
- name: Build
run: cargo build --release --locked --bin balatro-seed-search
- name: Stage binary
shell: bash
run: |
mkdir -p "../dist/${{ matrix.artifact }}"
cp "target/release/${{ matrix.binary }}" "../dist/${{ matrix.artifact }}/"
cp ../README.md ../LICENSE "../dist/${{ matrix.artifact }}/"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dist/${{ matrix.artifact }}
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- name: Create archives
run: |
for directory in dist/*; do
tar -C "$directory" -czf "${directory}.tar.gz" .
done
- uses: softprops/action-gh-release@v2
with:
files: dist/*.tar.gz

View File

@ -66,7 +66,7 @@ $ balatro-seed-search inspect 1111111Q \
```text
cargo test --release --all-targets --locked PASS (34 engine, 16 CLI)
cargo clippy --all-targets --locked -- -D warnings PASS
cargo run --release --bin verify -- 10000 PASS (0 hard failures)
cargo run --release --example verify -- 10000 PASS (0 hard failures)
```
## Known limitation

View File

View File

@ -2,6 +2,7 @@
name = "balatro-seed-engine"
version = "0.1.0"
edition = "2021"
autobins = false
description = "Native Rust CLI and engine for searching Balatro seeds"
license = "MIT"

View File

@ -6,7 +6,6 @@ deterministic RNG and item derivations. It runs entirely as a native process.
The direct workflow is searching for one or more jokers on or before an ante:
```bash
cd engine
cargo run --release --bin balatro-seed-search -- \
find-jokers --joker Blueprint --before-ante 2
@ -29,12 +28,12 @@ Build the optimized binary with a current stable Rust toolchain:
```bash
git clone <repository-url>
cd Balatro-Seed-Searcher/engine
cd Balatro-Seed-Searcher
cargo build --release --locked --bin balatro-seed-search
./target/release/balatro-seed-search --help
```
Tagged releases are packaged for Linux x86-64, macOS ARM64, and Windows x86-64.
Tagged releases are packaged as native command-line binaries.
## Friendly joker search
@ -152,11 +151,10 @@ as verified parity.
## Development
```bash
cd engine
cargo test --release --all-targets --locked
cargo clippy --all-targets --locked -- -D warnings
cargo run --release --bin verify -- 100000
cargo run --release --bin bench_throughput
cargo run --release --example verify -- 100000
cargo run --release --example bench_throughput
```
The benchmark binary covers joker, boss, voucher, tag, pack, and mixed filters.

33
TASK.md
View File

@ -8,13 +8,13 @@ non-negotiable commit and correctness rules.
Useful native code to retain:
- `engine/src/{rng,seed,instance,state,derive,items,tables}.rs`: deterministic
- `src/{rng,seed,instance,state,derive,items,tables}.rs`: deterministic
seed and run derivation core.
- `engine/src/filter.rs`: serializable filter DSL and compiled operations.
- `engine/src/search.rs`: serial and optional Rayon range scanning.
- `engine/src/inspect.rs`: target-independent seed inspection and overview data.
- `engine/src/bin/{verify,bench_throughput,smoke_anyof,smoke_filters}.rs` and
`engine/benches/throughput.rs`: regression and performance references.
- `src/filter.rs`: serializable filter DSL and compiled operations.
- `src/search.rs`: serial and optional Rayon range scanning.
- `src/inspect.rs`: target-independent seed inspection and overview data.
- `examples/{verify,bench_throughput,smoke_anyof,smoke_filters}.rs` and
`benches/throughput.rs`: regression and performance references.
Known gaps to address:
@ -145,3 +145,24 @@ Known gaps to address:
claims.
- Checks: full clean build/test/lint suite and acceptance command transcript.
- Commit: `test: complete native CLI acceptance pass`.
- [x] **11. Make the repository a single root Rust package.**
- Move the engine crate to the repository root and keep only the supported CLI
as a binary target.
- Preserve verifier, smoke, probe, and throughput utilities as examples so a
release publisher cannot mistake them for distributable applications.
- Remove the superseded GitHub-specific release workflow and update all
documented paths and commands.
- Checks: `cargo test --all-targets --locked`; `cargo clippy --all-targets
--locked -- -D warnings`; `git diff --check`.
- Commit: `refactor: flatten native Rust package`.
- [ ] **12. Adopt the rust_realease publishing contract.**
- Add package repository and cargo-binstall metadata matching the release
archive layout.
- Add `rust-release.toml` and Cross target configuration for the supported
Linux and Windows targets.
- Document release validation and run the publisher's dry-run checks.
- Checks: full Rust quality gates; `rust_realease . --dry-run`; metadata and
archive-name review.
- Commit: `build: configure rust_realease publishing`.

View File

@ -14,7 +14,7 @@
//! this engine. The README documents this gap honestly.
//!
//! Usage:
//! cargo run --release --bin verify -- [N]
//! cargo run --release --example verify -- [N]
//! where N is the number of seeds to sweep (default 100_000).
use balatro_seed_engine::derive::{