Skip to content
Open
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
16f0f3c
Centralise lint check-cfg policy (#200)
leynos Aug 23, 2026
b35c33f
Record staged lint onboarding (#200)
leynos Aug 23, 2026
7add2be
Opt in core lint policy (#200)
leynos Aug 23, 2026
7d6d18f
Use standard module layouts in core (#200)
leynos Aug 23, 2026
bd30d2c
Format core Rustdoc identifiers (#200)
leynos Aug 23, 2026
dec4722
Document core error contracts (#200)
leynos Aug 24, 2026
b049011
Mark core values as must-use (#200)
leynos Aug 24, 2026
06a6332
Adopt core let-else bindings (#200)
leynos Aug 24, 2026
1761bfd
Clarify core ignored test scope (#200)
leynos Aug 24, 2026
50cfb8a
Remove unused core method receivers (#200)
leynos Aug 24, 2026
931c7a6
Avoid unreachable default construction (#200)
leynos Aug 24, 2026
4969232
Make test invariants explicit (#200)
leynos Aug 24, 2026
bf46432
Bypass an unavailable cache shard (#200)
leynos Aug 24, 2026
1ab999e
Name the core-distance test discard (#200)
leynos Aug 24, 2026
af757de
Name distance values distinctly (#200)
leynos Aug 24, 2026
fb47140
Name HNSW validation values distinctly (#200)
leynos Aug 24, 2026
d55f8ff
Name graph and MST values distinctly (#200)
leynos Aug 24, 2026
f8035d8
Clarify HNSW insertion mutations (#200)
leynos Aug 24, 2026
6b1ffd3
Name session test handles distinctly (#200)
leynos Aug 24, 2026
73f3c9c
Guard CPU pipeline edge lookups (#200)
leynos Aug 24, 2026
bea7b83
Guard batch distance output access (#200)
leynos Aug 24, 2026
f3948bd
Make distance arithmetic boundaries explicit (#200)
leynos Aug 24, 2026
cf6ce57
Validate condensed hierarchy references (#200)
leynos Aug 24, 2026
f1e76f7
Validate linkage forest construction (#200)
leynos Aug 24, 2026
cac11bd
Simplify hierarchy endpoint validation (#200)
leynos Aug 24, 2026
5eb3447
Clarify hierarchy cluster-size bindings (#200)
leynos Aug 24, 2026
6e3f9f2
Validate hierarchy label references (#200)
leynos Aug 24, 2026
6d3dc7e
Validate stable hierarchy selection (#200)
leynos Aug 24, 2026
2a19caa
Validate hierarchy union-find access (#200)
leynos Aug 24, 2026
9bd1b4f
Declare HNSW construction dependencies (#200)
leynos Aug 24, 2026
0a349f5
Zip HNSW trim scoring inputs (#200)
leynos Aug 24, 2026
6971a31
Clarify HNSW cache usage markers (#200)
leynos Aug 24, 2026
4ab39b4
Check HNSW cache shard arithmetic (#200)
leynos Aug 24, 2026
2e2de56
Clarify HNSW optional defaults (#200)
leynos Aug 24, 2026
a0c37e8
Validate HNSW batch distance slots (#200)
leynos Aug 24, 2026
a4fc046
Iterate HNSW reciprocal edge buckets (#200)
leynos Aug 24, 2026
47420f9
Simplify HNSW evicted-edge cleanup (#200)
leynos Aug 24, 2026
bc13e73
Borrow HNSW insertion planning inputs (#200)
leynos Aug 24, 2026
bdb1b8d
Elide HNSW reciprocal-selection lifetimes (#200)
leynos Aug 24, 2026
0232dc8
Clarify HNSW reverse-edge eviction naming (#200)
leynos Aug 24, 2026
6de4456
Validate HNSW staged neighbour levels (#200)
leynos Aug 24, 2026
a562dcf
Borrow HNSW reachability neighbour tasks (#200)
leynos Aug 24, 2026
10fef2a
Guard HNSW reachability visit state (#200)
leynos Aug 24, 2026
836c6e3
Guard HNSW invalid-level neighbour access (#200)
leynos Aug 24, 2026
a05e3bc
Check HNSW level conversion bounds (#200)
leynos Aug 24, 2026
c6679a8
Harden HNSW sampling and cache validation (#200)
leynos Aug 24, 2026
f3df9ce
Format binary memory displays exactly (#200)
leynos Aug 24, 2026
eb89384
Validate MST union-find table access (#200)
leynos Aug 24, 2026
7216035
Group MST edges without direct float comparison (#200)
leynos Aug 24, 2026
00a826b
Validate session core-distance state (#200)
leynos Aug 24, 2026
7aa3d2e
Harden distance integration assertions (#200)
leynos Aug 24, 2026
6dc68b8
Harden datasource test fixtures (#200)
leynos Aug 24, 2026
3aa3bb5
Harden functional clustering tests (#200)
leynos Aug 24, 2026
0241f1e
Propagate session append fixture errors (#200)
leynos Aug 24, 2026
5af6a4e
Harden batch-first datasource tests (#200)
leynos Aug 24, 2026
3162c04
Harden hierarchy test helpers (#200)
leynos Aug 24, 2026
a26713a
Harden shared HNSW and session fixtures (#200)
leynos Aug 24, 2026
681d508
Propagate reachability test failures (#200)
leynos Aug 24, 2026
5ef1d31
Harden HNSW invariant test sources (#200)
leynos Aug 24, 2026
00f5640
Harden HNSW construction tests (#200)
leynos Aug 24, 2026
c9109b5
Stabilise HNSW error test sources (#200)
leynos Aug 24, 2026
1d496e2
Harden HNSW write-lock properties (#200)
leynos Aug 24, 2026
6121783
Harden HNSW property support helpers (#200)
leynos Aug 24, 2026
bec0014
Harden HNSW cache assertions (#200)
leynos Aug 24, 2026
d2c8287
Harden HNSW search tests (#200)
leynos Aug 24, 2026
f302feb
Harden HNSW sampling tests (#200)
leynos Aug 24, 2026
51cae57
Harden HNSW property support leaves (#200)
leynos Aug 24, 2026
564d6cd
Harden MST test union-find access (#200)
leynos Aug 24, 2026
4858c5c
Harden MST property strategies (#200)
leynos Aug 24, 2026
f1d9589
Harden MST property oracle unions (#200)
leynos Aug 24, 2026
d541a29
Harden MST forest property checks (#200)
leynos Aug 24, 2026
6a1fb14
Harden edge-harvest coverage tests (#200)
leynos Aug 24, 2026
12dc1de
Harden HNSW graph metric properties (#200)
leynos Aug 24, 2026
0cb8629
Harden edge-harvest property checks (#200)
leynos Aug 24, 2026
d014526
Harden MST property helper access (#200)
leynos Aug 24, 2026
07b74e1
Harden edge-harvest test support (#200)
leynos Aug 24, 2026
6a65633
Harden MST property accumulation (#200)
leynos Aug 24, 2026
b53d372
Split HNSW fixture property checks (#200)
leynos Aug 24, 2026
77547bf
Clarify HNSW fixture error assertions (#200)
leynos Aug 24, 2026
3b55012
Harden HNSW search properties (#200)
leynos Aug 24, 2026
8793bfa
Harden HNSW search configuration tests (#200)
leynos Aug 24, 2026
ccb4fb1
Harden graph topology property checks (#200)
leynos Aug 24, 2026
7a42b79
Harden graph topology generators (#200)
leynos Aug 24, 2026
0632a6b
Harden insertion executor tests (#200)
leynos Aug 24, 2026
5fc69c9
Harden HNSW mutation properties (#200)
leynos Aug 24, 2026
5f2083d
Harden edge-harvest output checks (#200)
leynos Aug 24, 2026
ee1938b
Harden HNSW property datasets (#200)
leynos Aug 24, 2026
8fe37c4
Harden HNSW property suite checks (#200)
leynos Aug 24, 2026
75ef8e6
Complete Whitaker lint remediation (#200)
leynos Aug 24, 2026
713671e
Harden bench-datasets test helpers and fixtures
leynos Aug 24, 2026
2f4ac9a
Harden chutoro-core test helpers and assertions
leynos Aug 24, 2026
0dae692
Harden cli and provider test helpers and assertions
leynos Aug 24, 2026
c38248f
Harden benches and test-support test helpers
leynos Aug 24, 2026
3002db5
Propagate byte-conversion errors in MNIST test helper
leynos Aug 24, 2026
c9c3ae5
Record rebase dependency decision (#200)
leynos Aug 24, 2026
7269c0f
Extract equal-distance search fixture
leynos Aug 24, 2026
ab97953
Enrol CLI in workspace lint policy (#200)
leynos Aug 24, 2026
5c77dca
Record dense lint enrolment boundary (#200)
leynos Aug 24, 2026
5401031
Narrow CLI filesystem lint exemption (#200)
leynos Aug 24, 2026
5bb272c
Enrol test support in workspace lints (#200)
leynos Aug 24, 2026
a500da4
Simplify sparse MST spanning-tree pairs
leynos Aug 24, 2026
9b9c4c6
Enrol dense provider in workspace lints
leynos Aug 24, 2026
dc9aa17
Enrol benches in workspace lint policy
leynos Aug 24, 2026
480606e
Document private lint-policy internals
leynos Aug 24, 2026
b980af3
Document core HNSW implementation state
leynos Aug 24, 2026
f9929a5
Document HNSW distance-cache internals
leynos Aug 24, 2026
87ff88d
Split distance-cache metric hooks
leynos Aug 24, 2026
765ee31
Document session core-distance internals
leynos Aug 24, 2026
1f2995d
Document single-linkage hierarchy internals
leynos Aug 24, 2026
229027b
Split HNSW search queue state
leynos Aug 24, 2026
0905134
Document insertion reciprocity internals
leynos Aug 24, 2026
2d63606
Document HNSW operation types
leynos Aug 24, 2026
7ab47ee
Document HNSW invariant internals
leynos Aug 24, 2026
7b6065b
Document concurrent MST union-find
leynos Aug 24, 2026
d7f1552
Document session state and configuration
leynos Aug 24, 2026
e75a940
Document MST construction internals
leynos Aug 24, 2026
d4a47e4
Document memory and result internals
leynos Aug 24, 2026
b77355f
Document HNSW distance validation
leynos Aug 24, 2026
6c5ea44
Document HNSW node parameters
leynos Aug 24, 2026
1a06cd7
Document HNSW invariant helpers
leynos Aug 24, 2026
4b301b0
Centralize distance-cache usage updates
leynos Aug 24, 2026
018c5ee
Document HNSW insertion staging
leynos Aug 24, 2026
ffbe85a
Document HNSW insertion support
leynos Aug 24, 2026
340e229
Document HNSW CPU internals
leynos Aug 24, 2026
64992ec
Document remaining core internals
leynos Aug 24, 2026
abeeb8a
Document provider internals
leynos Aug 24, 2026
9eea3c6
Document CLI and benchmark internals
leynos Aug 24, 2026
8d5ee7f
Document benchmark binary internals
leynos Aug 24, 2026
f4584ac
Finish workspace lint onboarding (#200)
leynos Aug 24, 2026
9120b4f
Record lint-policy publication state (#200)
leynos Aug 24, 2026
acf27f8
Resolve review findings across workspace (#200)
leynos Aug 24, 2026
aafc3c3
Add f64 check executable
leynos Aug 24, 2026
7c0b1e2
Record lint-policy completion evidence (#200)
leynos Aug 24, 2026
efa4564
Extract reverse-edge eviction fixture
leynos Aug 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,036 changes: 512 additions & 524 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rust-version = "1.89.0"
[workspace.dependencies]
arrow-array = "59.2.0"
arrow-schema = "59.2.0"
num-traits = "0.2.19"
parquet = "59.2.0"

[workspace.lints.clippy]
Expand Down Expand Up @@ -83,10 +84,19 @@ missing_panics_doc = "deny"
error_impl_error = "deny"
result_large_err = "deny"

# 9. documentation coverage
missing_docs_in_private_items = "deny"

[workspace.lints.rust]
unknown_lints = "deny"
renamed_and_removed_lints = "deny"
missing_docs = "deny"
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(kani)',
'cfg(coverage)',
'cfg(nightly)',
'cfg(dylint_lib, values(any()))',
] }

[workspace.lints.rustdoc]
missing_crate_level_docs = "deny"
Expand Down
Binary file added check-f64
Binary file not shown.
3 changes: 3 additions & 0 deletions chutoro-bench-datasets/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ use crate::{Fetcher, Publisher, Storage};

/// Borrowed port bundle supplied to recipe phases.
pub struct RecipeContext<'a> {
/// Port that retrieves the recipe's source artefacts.
fetcher: &'a dyn Fetcher,
/// Port that persists validated and prepared artefacts.
storage: &'a dyn Storage,
/// Port that publishes the completed dataset representation.
publisher: &'a dyn Publisher,
}

Expand Down
11 changes: 11 additions & 0 deletions chutoro-bench-datasets/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub fn run_recipe<R: DatasetRecipe>(
)
}

/// Run one recipe phase and initiate cleanup when it fails.
fn execute_phase<R, T>(
recipe: &R,
ctx: &RecipeContext<'_>,
Expand All @@ -85,13 +86,17 @@ where
})
}

/// Progress metadata for a recipe phase being run.
#[derive(Clone, Copy, Debug)]
struct PhaseExecution {
/// Last phase known to have completed before the active phase started.
highest_completed_phase: Option<Phase>,
/// Phase that is about to be executed.
phase: Phase,
}

impl PhaseExecution {
/// Describe the active phase and its last completed predecessor.
const fn new(highest_completed_phase: Option<Phase>, phase: Phase) -> Self {
Self {
highest_completed_phase,
Expand All @@ -100,14 +105,19 @@ impl PhaseExecution {
}
}

/// Failure metadata retained while recipe cleanup runs.
#[derive(Debug)]
struct PhaseFailure {
/// Last phase known to have completed before the failure.
highest_completed_phase: Option<Phase>,
/// Phase whose execution returned the original error.
failed_phase: Phase,
/// Error returned by the failed phase before cleanup ran.
original: RecipeError,
}

impl PhaseFailure {
/// Bundle the phase progress and error needed by cleanup.
const fn new(
highest_completed_phase: Option<Phase>,
failed_phase: Phase,
Expand All @@ -121,6 +131,7 @@ impl PhaseFailure {
}
}

/// Run recipe cleanup and preserve the original failure when cleanup succeeds.
fn cleanup_after_error<R: DatasetRecipe>(
recipe: &R,
ctx: &RecipeContext<'_>,
Expand Down
1 change: 1 addition & 0 deletions chutoro-bench-datasets/src/newtypes/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct CacheKey(Utf8PathBuf);
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct ObjectKey(Utf8PathBuf);

/// Implement the common path-wrapper API for a recipe storage key type.
macro_rules! impl_path_key {
($name:ident, $create_doc:literal, $example_path:literal) => {
impl $name {
Expand Down
3 changes: 3 additions & 0 deletions chutoro-bench-datasets/src/newtypes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl Display for RecipeVersion {
}
}

/// Parse one required unsigned component of a recipe version.
fn parse_version_part(part: Option<&str>, value: &str) -> Result<u16, RecipeError> {
part.ok_or_else(|| RecipeError::invalid_version(value))?
.parse::<u16>()
Expand Down Expand Up @@ -156,10 +157,12 @@ impl Display for SourceUrl {
}
}

/// Report whether `value` begins with one of the supported URL schemes.
fn is_supported_source_scheme(value: &str) -> bool {
value.starts_with("https://") || value.starts_with("s3://") || value.starts_with("file://")
}

/// Report whether `value` has content after its URL scheme separator.
fn has_non_empty_source_remainder(value: &str) -> bool {
value
.split_once("://")
Expand Down
3 changes: 3 additions & 0 deletions chutoro-bench-datasets/src/published.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::ManifestDigest;
mod sealed {
//! Seals `PublishedArtefact` so only crate-owned artefact types implement it.

/// Private sealing trait implemented by crate-owned published artefacts.
pub trait Sealed {}
}

Expand Down Expand Up @@ -53,7 +54,9 @@ pub trait PublishedArtefact: sealed::Sealed + Send + Sync {
#[non_exhaustive]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PublishedManifest {
/// UTF-8 path of the manifest produced by the recipe.
manifest_uri: Utf8PathBuf,
/// Digest that identifies the produced manifest content.
manifest_digest: ManifestDigest,
}

Expand Down
2 changes: 2 additions & 0 deletions chutoro-bench-datasets/src/testing/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::{Fetcher, PortName, RecipeError, SourceUrl};
/// Fetcher that reads `file://` URLs relative to a fixture root.
#[derive(Clone, Debug)]
pub struct FilesystemFetcher {
/// Ambient fixture directory used as the fetcher's capability root.
root: Utf8PathBuf,
}

Expand Down Expand Up @@ -63,6 +64,7 @@ impl Fetcher for FilesystemFetcher {
}
}

/// Validate and extract a relative file path from a `file://` source URL.
fn relative_file_path(url: &SourceUrl) -> Result<&Utf8Path, RecipeError> {
let value = url.as_ref();
let relative = value
Expand Down
4 changes: 4 additions & 0 deletions chutoro-bench-datasets/src/testing/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use crate::{CacheKey, Fetcher, ObjectKey, PortName, Publisher, RecipeError, Sour
/// In-memory source fetcher.
#[derive(Clone, Debug, Default)]
pub struct InMemoryFetcher {
/// Bytes available for each configured source URL.
sources: Arc<HashMap<SourceUrl, Bytes>>,
/// Request order captured for fixture assertions.
requested: Arc<Mutex<Vec<SourceUrl>>>,
}

Expand Down Expand Up @@ -94,6 +96,7 @@ impl Fetcher for InMemoryFetcher {
/// cross-process cache coordination.
#[derive(Debug, Default)]
pub struct InMemoryStorage {
/// Mutable cache records retained by the in-process adapter.
records: Mutex<HashMap<CacheKey, Bytes>>,
}

Expand Down Expand Up @@ -148,6 +151,7 @@ impl Storage for InMemoryStorage {
/// In-memory publisher for final artefacts.
#[derive(Debug, Default)]
pub struct InMemoryPublisher {
/// Published object records retained by the in-process adapter.
records: Mutex<HashMap<ObjectKey, Bytes>>,
}

Expand Down
5 changes: 5 additions & 0 deletions chutoro-bench-datasets/src/testing/stub_recipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ use crate::{
RecipeError, RecipeId, RecipeVersion, SourceSpec, SourceUrl,
};

/// Default per-source byte ceiling used by the deterministic stub recipe.
const DEFAULT_MAX_BYTES: usize = 1024 * 1024;

/// Simple recipe that fetches every source and publishes concatenated bytes.
#[derive(Clone, Debug)]
pub struct StubRecipe {
/// Stable identifier used by the fixture recipe.
id: RecipeId,
/// Fixture recipe version returned to the driver.
version: RecipeVersion,
/// Primary source specifications fetched by the fixture recipe.
sources: Vec<SourceSpec>,
/// Per-source byte limit enforced by the fixture recipe.
max_bytes: usize,
}

Expand Down
23 changes: 23 additions & 0 deletions chutoro-bench-datasets/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//! Shared assertion helpers for `chutoro-bench-datasets` integration tests.
//!
//! This module lives in a `tests/common` subdirectory (rather than a bare
//! `tests/common.rs`) so Cargo does not treat it as its own standalone test
//! crate; consumers pull it in with `mod common;`.

/// Asserts that `$expr` evaluates to `Err` and yields the wrapped error,
/// panicking at the call site with the supplied message if it does not.
///
/// Implemented as a macro (rather than a helper function) so a failed
/// assertion's panic location points at the calling test, matching the
/// diagnostics produced by the `let Err(error) = ... else { panic!(...) };`
/// idiom it replaces.
macro_rules! expect_err {
($expr:expr, $($panic_arg:tt)+) => {
match $expr {
Err(error) => error,
Ok(_) => panic!($($panic_arg)+),
}
};
}

pub(crate) use expect_err;
29 changes: 13 additions & 16 deletions chutoro-bench-datasets/tests/newtypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
use chutoro_bench_datasets::{RecipeError, RecipeVersion, SourceRole, SourceSpec, SourceUrl};
use rstest::rstest;

mod common;
use common::expect_err;

#[rstest]
#[case::https("https://")]
#[case::s3("s3://")]
#[case::file("file://")]
fn source_url_rejects_scheme_without_source_remainder(#[case] value: &str) {
let Err(error) = SourceUrl::parse(value) else {
panic!("scheme-only source URL should fail");
};

assert!(matches!(error, RecipeError::InvalidSource(_)));
}

#[test]
fn source_url_rejects_unsupported_scheme() {
let Err(error) = SourceUrl::parse("ftp://example.test/x") else {
panic!("unsupported source URL scheme should fail");
};
#[case::ftp("ftp://example.test/x")]
fn source_url_rejects_invalid_scheme(#[case] value: &str) {
let error = expect_err!(
SourceUrl::parse(value),
"invalid source URL should fail: {value}"
);

assert!(matches!(error, RecipeError::InvalidSource(_)));
}
Expand All @@ -30,9 +26,10 @@ fn source_url_rejects_unsupported_scheme() {
#[case::non_numeric("a.b.c")]
#[case::negative("-1.2.3")]
fn recipe_version_rejects_malformed_input(#[case] value: &str) {
let Err(error) = RecipeVersion::parse(value) else {
panic!("malformed version should fail: {value}");
};
let error = expect_err!(
RecipeVersion::parse(value),
"malformed version should fail: {value}"
);

assert!(matches!(error, RecipeError::InvalidVersion(_)));
}
Expand Down
Loading
Loading