Skip to content

chore(deps): bump rand_distr from 0.5.1 to 0.6.0#67

Merged
hyperpolymath merged 1 commit into
mainfrom
dependabot/cargo/rand_distr-0.6.0
May 21, 2026
Merged

chore(deps): bump rand_distr from 0.5.1 to 0.6.0#67
hyperpolymath merged 1 commit into
mainfrom
dependabot/cargo/rand_distr-0.6.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 21, 2026

Copy link
Copy Markdown
Contributor

Bumps rand_distr from 0.5.1 to 0.6.0.

Changelog

Sourced from rand_distr's changelog.

[0.6.0] — 2026-02-10

  • Bump to MSRV 1.85.0 and Edition 2024 in line with rand (#28)
  • Update rand to version 0.10.0 (#31, #48)

Additions

  • MultiDistribution trait to sample more efficiently from multi-dimensional distributions (#18)
  • Add WeightedAliasIndex::weights() to reconstruct the original weights in O(n) (#25)
  • ConstMultiDistribution trait as support for fixed-dimension distributions (#29)

Changes

  • Moved Dirichlet into the new multi module and implement MultiDistribution for it (#18)
  • Dirichlet no longer uses const generics, which means that its size is not required at compile time. Essentially a revert of [rand#1292]. (#30)

Fixes

  • Fix Geometric::new for small p > 0 where 1 - p rounds to 1 (#36)
  • Use direct-minimal-versions (#38)
  • Fix panic in FisherF::new on almost zero parameters (#39)
  • Fix panic in NormalInverseGaussian::new with very large alpha; this is a Value-breaking change (#40)
  • Fix hang and debug assertion in Zipf::new on invalid parameters (#41)
  • Fix panic in Binomial::sample with n ≥ 2^63; this is a Value-breaking change (#43)
  • Error instead of producing -inf output for Exp when lambda is -0.0 (#44)
  • Avoid returning NaN from Gamma::sample; this is a Value-breaking change and also affects ChiSquared and Dirichlet (#46)
Commits
  • 61d08aa Update rand 0.10 (#50)
  • c97a8f5 Merge pull request #46 from mstoeckl/gamma-avoid-nan
  • df52389 Merge pull request #51 from rust-random/push-qyyzynmpkuuo
  • 35ecffe CHANGELOG fixes
  • 06f586e Merge pull request #48 from mstoeckl/update-rand
  • 7540326 Merge pull request #49 from rust-random/push-kzzruutkmsxs
  • a101e4e Add PR links to the CHANGELOG
  • df2bae8 Update rand dependency to latest rc
  • be28239 Merge pull request #41 from mstoeckl/zipf-edge-case
  • 9a8000b Avoid hangs and debug asserts on invalid parameters for Zipf
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [rand_distr](https://github.com/rust-random/rand_distr) from 0.5.1 to 0.6.0.
- [Release notes](https://github.com/rust-random/rand_distr/releases)
- [Changelog](https://github.com/rust-random/rand_distr/blob/master/CHANGELOG.md)
- [Commits](rust-random/rand_distr@0.5.1...0.6.0)

---
updated-dependencies:
- dependency-name: rand_distr
  dependency-version: 0.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels May 21, 2026
@hyperpolymath
hyperpolymath merged commit b1c1b2d into main May 21, 2026
19 of 25 checks passed
@hyperpolymath
hyperpolymath deleted the dependabot/cargo/rand_distr-0.6.0 branch May 21, 2026 06:51
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 25 issues detected

Severity Count
🔴 Critical 5
🟠 High 13
🟡 Medium 7

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "No test directory or test files found",
    "type": "no_tests",
    "file": "/home/runner/work/neurophone/neurophone",
    "action": "flag",
    "rule_module": "honest_completion",
    "severity": "high",
    "deduction": 20
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (1 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/neurophone/neurophone/crates/sensors/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (12 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/neurophone/neurophone/crates/sensors/benches/sensors_bench.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (5 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/neurophone/neurophone/crates/llm/benches/llm_bench.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (2 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/neurophone/neurophone/crates/lsm/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "expect() in hot path (1 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/neurophone/neurophone/crates/lsm/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (1 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/neurophone/neurophone/crates/lsm/benches/lsm_bench.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

hyperpolymath added a commit that referenced this pull request Jun 6, 2026
## Summary

Sub-PR #4 of the Android Kotlin→Rust/Gossamer migration (epic #83, RFC
#97, sub-issue #110). Implements the native (`neurophone_android`) JNI
surface, replacing the `pub fn hello()` stub with the full 11-method
`ai.neurophone.NativeLib` contract. The most independent step of the
migration — no Service/widget/UI code is touched.

Each `Java_ai_neurophone_NativeLib_*` export decodes its JVM arguments
and delegates to the existing pure-Rust workspace crates:
- `neurophone-core` (`NeuroSymbolicSystem`) — lifecycle, sensor
processing, neural context, state, hybrid query router.
- `llm` (`MockBackend`) — on-device LLM stand-in (`llama.cpp` swaps in
later).
- `claude-client` (`HybridInference` / `ClaudeClient`) — cloud path,
with a graceful "no API key" branch.
- `sensors` (`SensorKind`) — Android sensor-type id mapping.

### JNI contract implemented (class `ai.neurophone.NativeLib`, lib
`neurophone_android`)
`init(String?)->bool`, `start()->bool`, `stop()->void`,
`processSensor(int, float[], long, int)->bool`,
`queryLocal(String)->String`, `queryClaude(String)->String`,
`query(String, bool)->String`, `getNeuralContext()->String`,
`getState()->String(JSON)`, `reset()->void`, `isRunning()->bool`.

Sensor-type id map per spec: accelerometer=1, magnetometer=2,
gyroscope=4, light=5, proximity=8, else unknown (rejected).

## Files changed
- **`crates/neurophone-android/src/lib.rs`** — full JNI implementation
(was a stub). A `Mutex`-guarded process-global `NativeRuntime`
singleton; safe `core_*` functions hold all logic; thin `unsafe extern
"C"` exports decode args and delegate. 7 unit tests.
- **`crates/neurophone-android/Cargo.toml`** — add `claude-client` and
`llm` path deps.
- **`Cargo.toml`** (workspace) — pin `jni = "0.21"`; revert
`rand`/`rand_distr` to `0.9`/`0.5` (see Risks).
- **`Cargo.lock`** — refreshed (`jni 0.21.1`, `rand 0.9.4`).

The Kotlin/Java bindings (`NativeLib.kt`, `MainActivity.kt`) are
intentionally **left untouched** — reconciled in the shim PRs /
legacy-delete step. Marked `TODO(#83)` in code.

## Unsafe-on-JNI-boundary justification
The crate is `#[deny(unsafe_code)]`. The JVM resolves native methods by
C symbol name (`Java_<class>_<method>`), which requires
`#[unsafe(no_mangle)]` + `unsafe extern "C"` — there is no safe-Rust
spelling of an exported C-ABI symbol, and the `jni` handles are raw
JVM-provided values. So:
- The crate-level lint was relaxed from `forbid` to
`#[deny(unsafe_code)]`.
- Each JNI export carries a **local, documented** `#[allow(unsafe_code)]
// JNI ABI: see module-level justification.`
- Every export body immediately hands off to a safe `core_*` function
and performs **no** `unsafe` operations beyond the ABI declaration. The
`unsafe` surface is purely the entry-point signatures, confined to the
`jni_boundary` module.

## What I verified
- `cargo build --workspace` — green.
- `cargo test --workspace` — green: **32 test binaries, all pass**,
incl. 7 new tests here (sensor id map, config fallback,
init/start/stop/reset lifecycle, sensor arity/type validation,
local/cloud/hybrid query paths, JSON state shape, and pre-init safety).
- `cargo clippy -p neurophone-android --all-targets` — no warnings.
- `nm -D libneurophone_android.so` — all **11**
`Java_ai_neurophone_NativeLib_*` symbols exported.

## TODOs / risks
- **`rand`/`rand_distr` revert (pre-existing breakage).** Dependabot PRs
#49/#67 bumped `rand 0.9→0.10` and `rand_distr 0.5→0.6`, but
`ndarray-rand 0.16` still requires `rand 0.9`. This breaks `esn`/`lsm`
the moment the lockfile is refreshed; the committed `Cargo.lock` pinned
`rand 0.9.4`, which masked the regression. I reverted to `0.9`/`0.5`
(with an explanatory `NOTE(#83)` in `Cargo.toml`) so the workspace
builds. Re-bump only alongside an `ndarray-rand` upgrade that supports
`rand 0.10`. Happy to split this into its own commit/PR if preferred.
- **`jni` pinned to 0.21.** The workspace previously declared `0.22`,
whose native-method API was reworked around `EnvUnowned::with_env` and
is still settling. 0.21's `JNIEnv`-first-arg surface keeps the FFI
boundary small and auditable. Only `neurophone-android` consumes `jni`,
so the blast radius is nil. Revisit when 0.22's API stabilises.
- **`MockBackend` for local LLM** is a deterministic stand-in; real
`llama.cpp` wiring is out of scope (tracked separately).
- **`queryClaude`** builds a short-lived current-thread tokio runtime
per call and requires an API key from the environment; without one it
returns a clear `[claude-unavailable]` string rather than failing the
FFI call. Per-call runtime is fine for the current call pattern; revisit
if it becomes hot.
- **Kotlin still references these symbols** — binding declarations
deliberately left as-is for the shim/legacy-delete PRs (`TODO(#83)`).

https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw)_

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant