From 77b2d6006a4e8d0876966df128b2bdcce2e1eb08 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Thu, 19 Nov 2026 15:04:58 -0500 Subject: [PATCH] build(test): add property libraries under one seed and budget convention The maintainer allowed one property library per language: qcheck for Gleam, Hypothesis for Python, rapid for Go, and proptest for the renderer. Each is test-only. Hypothesis is a dependency group of the kernel project, and the development shell's python3 is a second environment that includes it. That environment has the same venv links and role aliases as the kernel one. The shipped kernel environment does not include it. Every library reads ALBEDO_PROPERTY_SEED (unset is the gate's fixed seed, `random` is fresh, an integer replays) and ALBEDO_PROPERTY_CASES, and a failure prints its seed with the shrunk value: - albedo_property (new test-support package) wraps qcheck.run. - test/hypothesis_profiles.py loads a derandomized gate profile, or a discovery profile whose example database lives under ALBEDO_TEST_TMP. - cli/internal/property maps the variables onto rapid's flags and turns off fail files. - native/render/src/property.rs builds the ProptestConfig and turns off proptest-regressions files. The renderer's `scaled` gains a property. The property fails when the rounding is broken on purpose. The Go vendorHash moves with go.sum. --- apps/albedo/gleam.toml | 2 + apps/albedo/manifest.toml | 9 +- cli/go.mod | 1 + cli/go.sum | 2 + cli/internal/property/property.go | 73 ++++++++++++ cli/internal/property/property_test.go | 19 +++ native/render/Cargo.lock | 75 ++++++++++++ native/render/Cargo.toml | 3 + native/render/src/fit.rs | 30 +++++ native/render/src/main.rs | 2 + native/render/src/property.rs | 41 +++++++ nix/devShells.nix | 4 +- nix/packages/tui.nix | 2 +- packages/albedo_property/.gitignore | 1 + packages/albedo_property/README.md | 12 ++ packages/albedo_property/gleam.toml | 17 +++ packages/albedo_property/manifest.toml | 28 +++++ packages/albedo_property/package.nix | 5 + .../albedo_property/src/albedo_property.gleam | 91 ++++++++++++++ .../test/albedo_property_test.gleam | 43 +++++++ python/package.nix | 29 +++-- python/pyproject.toml | 5 + python/uv.lock | 111 ++++++++++++++++++ test/hypothesis_profiles.py | 71 +++++++++++ 24 files changed, 663 insertions(+), 13 deletions(-) create mode 100644 cli/internal/property/property.go create mode 100644 cli/internal/property/property_test.go create mode 100644 native/render/src/property.rs create mode 100644 packages/albedo_property/.gitignore create mode 100644 packages/albedo_property/README.md create mode 100644 packages/albedo_property/gleam.toml create mode 100644 packages/albedo_property/manifest.toml create mode 100644 packages/albedo_property/package.nix create mode 100644 packages/albedo_property/src/albedo_property.gleam create mode 100644 packages/albedo_property/test/albedo_property_test.gleam create mode 100644 test/hypothesis_profiles.py diff --git a/apps/albedo/gleam.toml b/apps/albedo/gleam.toml index 54ec9f30b..099143d15 100644 --- a/apps/albedo/gleam.toml +++ b/apps/albedo/gleam.toml @@ -105,6 +105,8 @@ aws_sigv4 = { path = "../../packages/aws_sigv4" } [dev_dependencies] gleeunit = ">= 1.0.0 and < 2.0.0" +qcheck = ">= 1.0.5 and < 2.0.0" +albedo_property = { path = "../../packages/albedo_property" } # Commit lint profile. See robot-docs/gleam-lint.md for review and audit modes. [tools.glinter] diff --git a/apps/albedo/manifest.toml b/apps/albedo/manifest.toml index ee99fdb85..0885e617c 100644 --- a/apps/albedo/manifest.toml +++ b/apps/albedo/manifest.toml @@ -46,7 +46,7 @@ packages = [ { name = "albedo_ext_paperclips", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_bytes", "albedo_sdk", "gleam_http", "gleam_json", "gleam_stdlib", "mist", "sqlight"], source = "local", path = "../../extensions/paperclips" }, { name = "albedo_ext_perplexity", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_bytes", "albedo_env", "albedo_http", "albedo_model", "albedo_models_dev", "albedo_openai", "albedo_sdk", "gleam_json", "gleam_stdlib"], source = "local", path = "../../extensions/perplexity" }, { name = "albedo_ext_persistent_agent", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_bytes", "albedo_clock", "albedo_lcm", "albedo_model", "albedo_process", "albedo_sdk", "gleam_stdlib", "sqlight"], source = "local", path = "../../extensions/persistent_agent" }, - { name = "albedo_ext_photon", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_clock", "albedo_env", "albedo_ports", "albedo_process", "albedo_sdk", "gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib", "sqlight"], source = "local", path = "../../extensions/photon" }, + { name = "albedo_ext_photon", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_clock", "albedo_env", "albedo_file", "albedo_http", "albedo_ports", "albedo_process", "albedo_sdk", "gleam_erlang", "gleam_http", "gleam_json", "gleam_otp", "gleam_stdlib", "sqlight"], source = "local", path = "../../extensions/photon" }, { name = "albedo_ext_proxy", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_bytes", "albedo_clock", "albedo_env", "albedo_model", "albedo_sdk", "gleam_erlang", "gleam_http", "gleam_json", "gleam_otp", "gleam_stdlib", "mist"], source = "local", path = "../../extensions/proxy" }, { name = "albedo_ext_remote", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_sdk", "gleam_stdlib"], source = "local", path = "../../extensions/remote" }, { name = "albedo_ext_rolling", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_rolling", "albedo_sdk", "gleam_stdlib", "sqlight"], source = "local", path = "../../extensions/rolling" }, @@ -75,6 +75,7 @@ packages = [ { name = "albedo_openai", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_bytes", "albedo_http", "albedo_json", "albedo_model", "albedo_model_stream", "albedo_sse", "gleam_json", "gleam_stdlib"], source = "local", path = "../../packages/albedo_openai" }, { name = "albedo_ports", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_clock", "albedo_protect", "gleam_erlang", "gleam_stdlib"], source = "local", path = "../../packages/albedo_ports" }, { name = "albedo_process", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_clock", "albedo_protect", "gleam_erlang", "gleam_otp", "gleam_stdlib"], source = "local", path = "../../packages/albedo_process" }, + { name = "albedo_property", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_env", "albedo_protect", "gleam_stdlib", "qcheck"], source = "local", path = "../../packages/albedo_property" }, { name = "albedo_protect", version = "0.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], source = "local", path = "../../packages/albedo_protect" }, { name = "albedo_rolling", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_model", "albedo_sdk", "gleam_stdlib", "sqlight"], source = "local", path = "../../packages/albedo_rolling" }, { name = "albedo_sdk", version = "0.1.0", build_tools = ["gleam"], requirements = ["albedo_bytes", "albedo_clock", "albedo_env", "albedo_file", "albedo_http", "albedo_image", "albedo_json", "albedo_model", "albedo_model_stream", "albedo_oauth", "albedo_openai", "albedo_ports", "albedo_process", "albedo_protect", "albedo_sqlite", "albedo_web", "gleam_crypto", "gleam_erlang", "gleam_http", "gleam_json", "gleam_otp", "gleam_stdlib", "mist", "sqlight", "yamerl"], source = "local", path = "../../packages/albedo_sdk" }, @@ -90,13 +91,17 @@ packages = [ { name = "gleam_http", version = "4.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "F065CE9941A7756ABBAEAE7F9F32A96CAD29DA3311A381DB2D926EA8E8C156DC" }, { name = "gleam_json", version = "3.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "44FDAA8847BE8FC48CA7A1C089706BD54BADCC4C45B237A992EDDF9F2CDB2836" }, { name = "gleam_otp", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "DE4CA6850842F0266EE95317A25DD6A0A0F20CDFAB7C0ADC2E63251D7C3C72EC" }, + { name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" }, { name = "gleam_stdlib", version = "1.0.5", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "CEE5B6C076A85B45F60C585F4316C63EC8B7127C119D5738C3958A9C4D50404E" }, + { name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" }, { name = "gleeunit", version = "1.11.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "EC31ABA74256AEA531EDF8169931D775BBB384FED0A8A1BDC4DD9354E3E21826" }, { name = "glisten", version = "9.0.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib", "logging"], otp_app = "glisten", source = "hex", outer_checksum = "7795AA50830656F3A0316A6B26595F893C83272DA901B3405E31339CAA31A10B" }, { name = "gramps", version = "6.0.1", build_tools = ["gleam"], requirements = ["gleam_crypto", "gleam_erlang", "gleam_http", "gleam_stdlib"], otp_app = "gramps", source = "hex", outer_checksum = "D55636072DEE173F6586A5679D3C02EC7A0DE3F8646B78C351B72908FF223DF7" }, { name = "hpack_erl", version = "0.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "hpack", source = "hex", outer_checksum = "D6137D7079169D8C485C6962DFE261AF5B9EF60FBC557344511C1E65E3D95FB0" }, { name = "logging", version = "1.5.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "logging", source = "hex", outer_checksum = "BC5F18CE5DD9686100229FE5409BDC3DD5C46D5A7DF2F804AD2D8F0DD6C5060E" }, { name = "mist", version = "6.0.3", build_tools = ["gleam"], requirements = ["exception", "gleam_erlang", "gleam_http", "gleam_otp", "gleam_stdlib", "glisten", "gramps", "hpack_erl", "logging"], source = "local", path = "../../vendor/mist" }, + { name = "prng", version = "6.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "prng", source = "hex", outer_checksum = "7FE3879E13150248BD370469205ED07B9404DD90670FEBB8CD0E7643707C420E" }, + { name = "qcheck", version = "1.0.5", build_tools = ["gleam"], requirements = ["exception", "gleam_regexp", "gleam_stdlib", "gleam_yielder", "prng"], otp_app = "qcheck", source = "hex", outer_checksum = "D27C12074776EC95F082EE56E0FC74685506B6EE26176F194D10F0322A39AC11" }, { name = "sqlight", version = "1.2.0", build_tools = ["gleam"], requirements = ["esqlite", "gleam_stdlib"], otp_app = "sqlight", source = "hex", outer_checksum = "841768D0A81107EE2DB46B949354F284A68B2E8098315C28A1FE3C07D206C17A" }, { name = "yamerl", version = "0.10.0", build_tools = ["rebar3"], requirements = [], otp_app = "yamerl", source = "hex", outer_checksum = "346ADB2963F1051DC837A2364E4ACF6EB7D80097C0F53CBDC3046EC8EC4B4E6E" }, ] @@ -170,6 +175,7 @@ albedo_oauth = { path = "../../packages/albedo_oauth" } albedo_openai = { path = "../../packages/albedo_openai" } albedo_ports = { path = "../../packages/albedo_ports" } albedo_process = { path = "../../packages/albedo_process" } +albedo_property = { path = "../../packages/albedo_property" } albedo_protect = { path = "../../packages/albedo_protect" } albedo_rolling = { path = "../../packages/albedo_rolling" } albedo_sdk = { path = "../../packages/albedo_sdk" } @@ -186,5 +192,6 @@ gleam_otp = { version = ">= 1.3.0 and < 2.0.0" } gleam_stdlib = { version = ">= 1.0.0 and < 2.0.0" } gleeunit = { version = ">= 1.0.0 and < 2.0.0" } mist = { path = "../../vendor/mist" } +qcheck = { version = ">= 1.0.5 and < 2.0.0" } sqlight = { version = ">= 1.2.0 and < 2.0.0" } yamerl = { version = ">= 0.10.0 and < 1.0.0" } diff --git a/cli/go.mod b/cli/go.mod index d37dd5389..6239ca43d 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -26,6 +26,7 @@ require ( go.yaml.in/yaml/v3 v3.0.5 golang.org/x/sys v0.48.0 golang.org/x/text v0.42.0 + pgregory.net/rapid v1.3.0 ) require ( diff --git a/cli/go.sum b/cli/go.sum index aaf14ee79..d7795ffe2 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -132,5 +132,7 @@ golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +pgregory.net/rapid v1.3.0 h1:vBvO0VSqti75J1jjYqpgPNBLKMd1+gxa9fYo7vk/Exc= +pgregory.net/rapid v1.3.0/go.mod h1:dPlE4OBBxgXPqkP79flB6sJL1dx5azpI7HQ9MY9Z7uk= tangled.org/okami.mom/glamour.git/v2 v2.0.0-20261013013552-052c391d9e1d h1:WdJvVvEk0H90bSm1iaa8OqCep803Zls5pO2giRkWZcY= tangled.org/okami.mom/glamour.git/v2 v2.0.0-20261013013552-052c391d9e1d/go.mod h1:jo9z8XqVKPeEFMVdvCRLGk++RyJ3CdUwgNr7EvXLw3k= diff --git a/cli/internal/property/property.go b/cli/internal/property/property.go new file mode 100644 index 000000000..edaf6189e --- /dev/null +++ b/cli/internal/property/property.go @@ -0,0 +1,73 @@ +// Package property runs rapid properties under the repository's seed and +// budget convention (robot-docs/testing.md#seeds-and-budgets). +// +// ALBEDO_PROPERTY_SEED unset runs the gate's fixed seed, "random" a fresh one, +// and a number that seed. ALBEDO_PROPERTY_CASES sets the checks per property. +// rapid's own -rapid.seed and -rapid.checks flags win when given. rapid prints +// the failing seed and the shrunk counterexample itself. Fail files are off: +// a counterexample is committed as a named example test instead. +// +// Import it only from _test files, so rapid stays out of the shipped binary. +package property + +import ( + "flag" + "fmt" + "os" + "strconv" + "sync" + "testing" + + "pgregory.net/rapid" +) + +// GateSeed is the seed every property runs with when ALBEDO_PROPERTY_SEED is +// unset, so the gate replays the same cases on every run. +const GateSeed uint64 = 1 + +var configure = sync.OnceValue(func() error { + given := map[string]bool{} + flag.Visit(func(f *flag.Flag) { given[f.Name] = true }) + seed, err := Seed(os.Getenv("ALBEDO_PROPERTY_SEED")) + if err != nil { + return err + } + if !given["rapid.seed"] { + if err := flag.Set("rapid.seed", strconv.FormatUint(seed, 10)); err != nil { + return err + } + } + if cases := os.Getenv("ALBEDO_PROPERTY_CASES"); cases != "" && !given["rapid.checks"] { + if err := flag.Set("rapid.checks", cases); err != nil { + return fmt.Errorf("ALBEDO_PROPERTY_CASES: %w", err) + } + } + if !given["rapid.nofailfile"] { + return flag.Set("rapid.nofailfile", "true") + } + return nil +}) + +// Seed maps ALBEDO_PROPERTY_SEED to rapid's seed, where 0 asks for a random one. +func Seed(value string) (uint64, error) { + switch value { + case "": + return GateSeed, nil + case "random": + return 0, nil + } + seed, err := strconv.ParseUint(value, 10, 64) + if err != nil || seed == 0 { + return 0, fmt.Errorf("ALBEDO_PROPERTY_SEED must be unset, \"random\", or a positive integer, not %q", value) + } + return seed, nil +} + +// Check runs prop with rapid.Check under the convention. +func Check(t *testing.T, prop func(*rapid.T)) { + t.Helper() + if err := configure(); err != nil { + t.Fatal(err) + } + rapid.Check(t, prop) +} diff --git a/cli/internal/property/property_test.go b/cli/internal/property/property_test.go new file mode 100644 index 000000000..cce355c0a --- /dev/null +++ b/cli/internal/property/property_test.go @@ -0,0 +1,19 @@ +package property + +import "testing" + +// A wrong mapping would make the gate random or ignore a reproduction seed. +func TestSeedMapsTheConvention(t *testing.T) { + cases := map[string]uint64{"": GateSeed, "random": 0, "42": 42} + for value, want := range cases { + got, err := Seed(value) + if err != nil || got != want { + t.Errorf("Seed(%q) = %d, %v; want %d", value, got, err, want) + } + } + for _, value := range []string{"0", "-1", "seed", "1.5"} { + if _, err := Seed(value); err == nil { + t.Errorf("Seed(%q) accepted", value) + } + } +} diff --git a/native/render/Cargo.lock b/native/render/Cargo.lock index 42bc7cff7..1d01200ce 100644 --- a/native/render/Cargo.lock +++ b/native/render/Cargo.lock @@ -27,6 +27,7 @@ dependencies = [ "fontdue", "image", "png", + "proptest", "unicode-width", "webp", ] @@ -727,6 +728,23 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" +[[package]] +name = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core", +] + +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "core_maths" version = "0.1.1" @@ -736,6 +754,15 @@ dependencies = [ "libm", ] +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.2" @@ -813,6 +840,7 @@ dependencies = [ "cfg-if", "libc", "r-efi", + "rand_core", ] [[package]] @@ -948,6 +976,22 @@ dependencies = [ "miniz_oxide 0.8.9", ] +[[package]] +name = "proptest" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0" +dependencies = [ + "bitflags", + "chacha20", + "core_detect", + "num-traits", + "rand", + "rand_xorshift", + "regex-syntax", + "unarray", +] + [[package]] name = "pxfm" version = "0.1.30" @@ -966,6 +1010,31 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" +[[package]] +name = "rand" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6fa277c67e6ea590466f04c3fe82cb509f0864fe470643e5570de9514a9b11" +dependencies = [ + "getrandom", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_xorshift" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf" +dependencies = [ + "rand_core", +] + [[package]] name = "regex" version = "1.13.1" @@ -1028,6 +1097,12 @@ dependencies = [ "core_maths", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-width" version = "0.2.2" diff --git a/native/render/Cargo.toml b/native/render/Cargo.toml index d2dd139d9..4dd55fdf9 100644 --- a/native/render/Cargo.toml +++ b/native/render/Cargo.toml @@ -75,3 +75,6 @@ features = [ [profile.release] lto = "thin" strip = true + +[dev-dependencies] +proptest = { version = "1.12.0", default-features = false, features = ["std"] } diff --git a/native/render/src/fit.rs b/native/render/src/fit.rs index 02da9bea5..86e19e029 100644 --- a/native/render/src/fit.rs +++ b/native/render/src/fit.rs @@ -204,6 +204,36 @@ fn scaled(width: u32, height: u32, edge: u32) -> (u32, u32) { #[cfg(test)] mod tests { use super::*; + use proptest::prelude::*; + + proptest! { + #![proptest_config(crate::property::config(256))] + + // An image larger than the edge shrinks so its longer side lands on + // the edge, keeps its aspect within rounding, and never loses a side. + #[test] + fn scaled_fits_the_longer_side_to_the_edge( + width in 1u32..20_000, + height in 1u32..20_000, + edge in 1u32..20_000, + ) { + let (w, h) = scaled(width, height, edge); + let longer = width.max(height); + prop_assert_eq!(w.max(h), longer.min(edge)); + prop_assert!(w >= 1 && h >= 1); + if longer <= edge { + prop_assert_eq!((w, h), (width, height)); + } else { + // w / edge differs from width / longer by at most half a pixel. + let exact = |side: u32, got: u32| { + (got as i64 * longer as i64 - side as i64 * edge as i64).abs() * 2 + <= longer as i64 + || got == 1 + }; + prop_assert!(exact(width, w) && exact(height, h)); + } + } + } #[test] fn the_longer_edge_lands_on_the_limit() { diff --git a/native/render/src/main.rs b/native/render/src/main.rs index 58b6628b9..df6f8266c 100644 --- a/native/render/src/main.rs +++ b/native/render/src/main.rs @@ -27,6 +27,8 @@ mod fit; mod grid; mod highlight; mod layout; +#[cfg(test)] +mod property; mod raster; use highlight::{Colors, Language}; diff --git a/native/render/src/property.rs b/native/render/src/property.rs new file mode 100644 index 000000000..ede484086 --- /dev/null +++ b/native/render/src/property.rs @@ -0,0 +1,41 @@ +//! The repository's seed and budget convention for proptest +//! (robot-docs/testing.md#seeds-and-budgets). +//! +//! `ALBEDO_PROPERTY_SEED` unset runs the gate's fixed seed, `random` a fresh +//! one, and a number that seed. `ALBEDO_PROPERTY_CASES` sets the cases per +//! property. Failure persistence is off: a counterexample is committed as a +//! named example test instead of a `proptest-regressions` file. + +use proptest::test_runner::{Config, RngSeed}; +use std::hash::{BuildHasher, RandomState}; + +/// The seed every property runs with when `ALBEDO_PROPERTY_SEED` is unset. +pub const GATE_SEED: u64 = 1; + +/// A config for a property that runs `gate_cases` cases in the gate. +/// +/// It prints the seed it chose. `cargo test` shows a test's output only when +/// the test fails, so a failure's log names the seed beside proptest's +/// minimal failing input. +pub fn config(gate_cases: u32) -> Config { + let seed = match std::env::var("ALBEDO_PROPERTY_SEED").as_deref() { + Err(_) => GATE_SEED, + Ok("random") => RandomState::new().hash_one(std::process::id()), + Ok(value) => value + .parse() + .expect("ALBEDO_PROPERTY_SEED must be unset, \"random\", or an integer"), + }; + let cases = match std::env::var("ALBEDO_PROPERTY_CASES") { + Ok(value) => value + .parse() + .expect("ALBEDO_PROPERTY_CASES must be an integer"), + Err(_) => gate_cases, + }; + eprintln!("ALBEDO_PROPERTY_SEED={seed} ALBEDO_PROPERTY_CASES={cases}"); + Config { + cases, + rng_seed: RngSeed::Fixed(seed), + failure_persistence: None, + ..Config::default() + } +} diff --git a/nix/devShells.nix b/nix/devShells.nix index 0c80491d2..06521a03f 100644 --- a/nix/devShells.nix +++ b/nix/devShells.nix @@ -10,7 +10,9 @@ _: { devShells.default = pkgs.mkShell { UV_TEST_WHEELS = config.packages.albedo-kernel-python.testWheels; packages = - [config.packages.albedo-kernel-python] + # The test environment comes first, so `python3` is the one with the + # test-only packages. The kernel environment keeps its role aliases. + [config.packages.albedo-kernel-python-test config.packages.albedo-kernel-python] ++ (with pkgs; [ go gopls diff --git a/nix/packages/tui.nix b/nix/packages/tui.nix index a72845173..129dfa702 100644 --- a/nix/packages/tui.nix +++ b/nix/packages/tui.nix @@ -28,7 +28,7 @@ in src = tuiSource; modRoot = "cli"; subPackages = ["cmd/albedo" "cmd/albedo-acp" "cmd/albedo-server" "cmd/albedo-tui" "cmd/albedo-web"]; - vendorHash = "sha256-Wk5+qMbSQaD4g08usd83Yiyz22xdBbdubnVgxsn7Wp4="; + vendorHash = "sha256-VZPnwSstJxEp8x5gIXMJ5jFH0j1vhPYeu2JYB/dKNZA="; nativeBuildInputs = [python311 makeBinaryWrapper]; ALBEDO_NO_BROWSER = "1"; ALBEDO_TEST_DAEMON = "${daemon}/bin/albedo-daemon"; diff --git a/packages/albedo_property/.gitignore b/packages/albedo_property/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/packages/albedo_property/.gitignore @@ -0,0 +1 @@ +/build diff --git a/packages/albedo_property/README.md b/packages/albedo_property/README.md new file mode 100644 index 000000000..c93cfc91c --- /dev/null +++ b/packages/albedo_property/README.md @@ -0,0 +1,12 @@ +# albedo_property + +`albedo_property` runs qcheck properties under the repository's seed and budget +convention. Use it from tests only, as a dev dependency. + +- [`albedo_property.run`](src/albedo_property.gleam) checks a property against + its gate budget with the gate's fixed seed. `ALBEDO_PROPERTY_SEED` and + `ALBEDO_PROPERTY_CASES` replace them. A failure panics with the seed and the + budget in front of qcheck's report of the original and shrunk values. +- `budget` maps the two variables to a seed and a case count. + +See [the testing reference](../../robot-docs/testing.md#seeds-and-budgets). diff --git a/packages/albedo_property/gleam.toml b/packages/albedo_property/gleam.toml new file mode 100644 index 000000000..c51c52d95 --- /dev/null +++ b/packages/albedo_property/gleam.toml @@ -0,0 +1,17 @@ +name = "albedo_property" +version = "0.1.0" +description = "Run qcheck properties under the repository's seed and budget convention: a fixed gate seed, ALBEDO_PROPERTY_SEED and ALBEDO_PROPERTY_CASES overrides, and the seed printed with every failure" +# The albedo repository's licence; see robot-docs/workspace-packages.md. +licences = ["AGPL-3.0-only"] +gleam = ">= 1.19.0" +target = "erlang" + +[dependencies] +gleam_stdlib = ">= 1.0.0 and < 2.0.0" +gleam_erlang = ">= 1.3.0 and < 2.0.0" +qcheck = ">= 1.0.5 and < 2.0.0" +albedo_env = { path = "../albedo_env" } +albedo_protect = { path = "../albedo_protect" } + +[dev_dependencies] +gleeunit = ">= 1.0.0 and < 2.0.0" diff --git a/packages/albedo_property/manifest.toml b/packages/albedo_property/manifest.toml new file mode 100644 index 000000000..1de357c08 --- /dev/null +++ b/packages/albedo_property/manifest.toml @@ -0,0 +1,28 @@ +# Do not manually edit this file, it is managed by Gleam. +# +# This file locks the dependency versions used, to make your build +# deterministic and to prevent unexpected versions from being included +# in your application. +# +# You should check this file into your source control repository. + +packages = [ + { name = "albedo_env", version = "0.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], source = "local", path = "../albedo_env" }, + { name = "albedo_protect", version = "0.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], source = "local", path = "../albedo_protect" }, + { name = "exception", version = "2.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "6BDEA95248093599391C3B5DF1835C5C6A86C353C2F99CE539B450E3432FE117" }, + { name = "gleam_erlang", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "1124AD3AA21143E5AF0FC5CF3D9529F6DB8CA03E43A55711B60B6B7B3874375C" }, + { name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" }, + { name = "gleam_stdlib", version = "1.0.5", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "CEE5B6C076A85B45F60C585F4316C63EC8B7127C119D5738C3958A9C4D50404E" }, + { name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" }, + { name = "gleeunit", version = "1.11.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "EC31ABA74256AEA531EDF8169931D775BBB384FED0A8A1BDC4DD9354E3E21826" }, + { name = "prng", version = "6.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "prng", source = "hex", outer_checksum = "7FE3879E13150248BD370469205ED07B9404DD90670FEBB8CD0E7643707C420E" }, + { name = "qcheck", version = "1.0.5", build_tools = ["gleam"], requirements = ["exception", "gleam_regexp", "gleam_stdlib", "gleam_yielder", "prng"], otp_app = "qcheck", source = "hex", outer_checksum = "D27C12074776EC95F082EE56E0FC74685506B6EE26176F194D10F0322A39AC11" }, +] + +[requirements] +albedo_env = { path = "../albedo_env" } +albedo_protect = { path = "../albedo_protect" } +gleam_erlang = { version = ">= 1.3.0 and < 2.0.0" } +gleam_stdlib = { version = ">= 1.0.0 and < 2.0.0" } +gleeunit = { version = ">= 1.0.0 and < 2.0.0" } +qcheck = { version = ">= 1.0.5 and < 2.0.0" } diff --git a/packages/albedo_property/package.nix b/packages/albedo_property/package.nix new file mode 100644 index 000000000..7e8ad6f11 --- /dev/null +++ b/packages/albedo_property/package.nix @@ -0,0 +1,5 @@ +{ + perSystem = {mkGleamPackage, ...}: { + gleamProjects."packages/albedo_property" = mkGleamPackage {dir = ./.;}; + }; +} diff --git a/packages/albedo_property/src/albedo_property.gleam b/packages/albedo_property/src/albedo_property.gleam new file mode 100644 index 000000000..7d1aa8825 --- /dev/null +++ b/packages/albedo_property/src/albedo_property.gleam @@ -0,0 +1,91 @@ +//// qcheck properties under the repository's seed and budget convention +//// (robot-docs/testing.md#seeds-and-budgets). +//// +//// `ALBEDO_PROPERTY_SEED` unset runs the gate's fixed seed, `random` a fresh +//// one, and an integer that seed. `ALBEDO_PROPERTY_CASES` replaces each +//// property's gate budget. A failure prints the seed and budget before +//// qcheck's report of the original and shrunk values, so the log alone +//// reproduces it. +//// +//// Use it from tests only: add it under `[dev_dependencies]`. + +import albedo_env +import albedo_protect +import gleam/dynamic/decode +import gleam/erlang/atom +import gleam/int +import gleam/option.{type Option, None, Some} +import gleam/result +import qcheck + +/// The seed every property runs with when `ALBEDO_PROPERTY_SEED` is unset. +pub const gate_seed = 1 + +/// The seed and case count one property runs with. +pub type Budget { + Budget(seed: Int, cases: Int) +} + +/// Check `property` against `gate_cases` generated values in the gate, or as +/// many as `ALBEDO_PROPERTY_CASES` asks for. It panics with the seed and +/// the shrunk value when a value fails. +pub fn run( + gate_cases: Int, + generator: qcheck.Generator(a), + property: fn(a) -> Nil, +) -> Nil { + let assert Ok(Budget(seed:, cases:)) = + budget( + albedo_env.lookup("ALBEDO_PROPERTY_SEED"), + albedo_env.lookup("ALBEDO_PROPERTY_CASES"), + gate_cases, + ) + as "ALBEDO_PROPERTY_SEED must be unset, \"random\", or an integer, and ALBEDO_PROPERTY_CASES a positive integer" + let config = + qcheck.default_config() + |> qcheck.with_seed(qcheck.seed(seed)) + |> qcheck.with_test_count(cases) + case albedo_protect.rescue(fn() { qcheck.run(config, generator, property) }) { + Ok(Nil) -> Nil + Error(crash) -> { + // qcheck's report, with the original and shrunk values, is the panic + // message. Keep it and name the seed in front of it. + let report = + decode.run( + crash.reason, + decode.at([atom.create("message")], decode.string), + ) + |> result.lazy_unwrap(fn() { albedo_protect.describe(crash.reason) }) + panic as { + "property failed with ALBEDO_PROPERTY_SEED=" + <> int.to_string(seed) + <> " ALBEDO_PROPERTY_CASES=" + <> int.to_string(cases) + <> "\n" + <> report + } + } + } +} + +/// The budget the two variables ask for. A random seed is drawn here, so the +/// failure report can name it. +pub fn budget( + seed: Option(String), + cases: Option(String), + gate_cases: Int, +) -> Result(Budget, Nil) { + let seed = case seed { + None | Some("") -> Ok(gate_seed) + Some("random") -> Ok(int.random(1_000_000_000)) + Some(text) -> int.parse(text) + } + let cases = case cases { + None | Some("") -> Ok(gate_cases) + Some(text) -> int.parse(text) + } + case seed, cases { + Ok(seed), Ok(cases) if cases > 0 -> Ok(Budget(seed:, cases:)) + _, _ -> Error(Nil) + } +} diff --git a/packages/albedo_property/test/albedo_property_test.gleam b/packages/albedo_property/test/albedo_property_test.gleam new file mode 100644 index 000000000..79ae9750a --- /dev/null +++ b/packages/albedo_property/test/albedo_property_test.gleam @@ -0,0 +1,43 @@ +//// A wrong mapping would make the gate random, ignore a reproduction seed, or +//// hide which seed failed. + +import albedo_property.{Budget} +import albedo_protect +import gleam/dynamic/decode +import gleam/erlang/atom +import gleam/option.{None, Some} +import gleam/string +import gleeunit +import qcheck + +pub fn main() -> Nil { + gleeunit.main() +} + +pub fn the_variables_choose_the_seed_and_budget_test() -> Nil { + assert albedo_property.budget(None, None, 50) + == Ok(Budget(seed: albedo_property.gate_seed, cases: 50)) + assert albedo_property.budget(Some("42"), Some("9000"), 50) + == Ok(Budget(seed: 42, cases: 9000)) + let assert Ok(Budget(cases: 50, ..)) = + albedo_property.budget(Some("random"), None, 50) + assert albedo_property.budget(Some("seed"), None, 50) == Error(Nil) + assert albedo_property.budget(None, Some("0"), 50) == Error(Nil) +} + +pub fn a_failure_still_fails_with_the_seed_and_shrunk_value_test() -> Nil { + let assert Error(crash) = + albedo_protect.rescue(fn() { + albedo_property.run(100, qcheck.bounded_int(0, 1000), fn(n) { + assert n < 10 + }) + }) + let assert Ok(report) = + decode.run(crash.reason, decode.at([atom.create("message")], decode.string)) + assert string.starts_with( + report, + "property failed with ALBEDO_PROPERTY_SEED=1 ALBEDO_PROPERTY_CASES=100\n", + ) + // qcheck shrinks the counterexample to the boundary. + assert string.contains(report, "10") +} diff --git a/python/package.nix b/python/package.nix index 850f015d7..c58f2acd2 100644 --- a/python/package.nix +++ b/python/package.nix @@ -18,7 +18,25 @@ nativeBuildInputs = (old.nativeBuildInputs or []) ++ final.resolveBuildSystem {setuptools = [];}; }); }))); + # A role alias must live beside the venv interpreter for CPython to find + # pyvenv.cfg. The daemon cannot create aliases in the immutable store. + # pyproject.nix's launcher rewrites argv[0] to pythonX.Y. Use CPython's + # normal venv link so named processes retain their role and prefix. + venvLinks = '' + ln -sfn "${python.interpreter}" "$out/bin/${python.executable}" + for role in bridge colab discord hook kernel photon-bridge pty signal spare ssh verifier watchdog zygote; do + ln -s python3 "$out/bin/albedo-$role" + done + ''; + # The kernel environment with the test-only dependency groups added. The + # development shell puts it first on PATH for the test code. A daemon + # started without ALBEDO_KERNEL_PYTHON runs kernels from it, so it takes + # the same links. Shipped daemons use albedo-kernel-python, without them. + testEnv = (pythonSet.mkVirtualEnv "albedo-kernel-python-test" workspace.deps.all).overrideAttrs { + postInstall = venvLinks; + }; in { + packages.albedo-kernel-python-test = testEnv; packages.albedo-kernel-python = (pythonSet.mkVirtualEnv "albedo-kernel-python" workspace.deps.default).overrideAttrs { # The loopback SSH tests install from these same wheels without network. passthru.testWheels = pkgs.linkFarm "albedo-kernel-test-wheels" ( @@ -27,16 +45,7 @@ path = package.src; }) (builtins.filter (package: lib.hasSuffix ".whl" (package.src.name or "")) (pythonSet.resolveVirtualEnv workspace.deps.default)) ); - # A role alias must live beside the venv interpreter for CPython to find - # pyvenv.cfg. The daemon cannot create aliases in the immutable store. - postInstall = '' - # pyproject.nix's launcher rewrites argv[0] to pythonX.Y. Use CPython's - # normal venv link so named processes retain their role and prefix. - ln -sfn "${python.interpreter}" "$out/bin/${python.executable}" - for role in bridge colab discord hook kernel photon-bridge pty signal spare ssh verifier watchdog zygote; do - ln -s python3 "$out/bin/albedo-$role" - done - ''; + postInstall = venvLinks; }; }; } diff --git a/python/pyproject.toml b/python/pyproject.toml index e26258cf6..a7e708158 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -10,3 +10,8 @@ dependencies = [ [tool.uv] package = false + +# Test-only packages: the development shell's Python has them, the shipped +# kernel environment does not (python/package.nix). +[dependency-groups] +test = ["hypothesis>=6"] diff --git a/python/uv.lock b/python/uv.lock index b4e989bf7..834308776 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -16,6 +16,11 @@ dependencies = [ { name = "pydantic" }, ] +[package.dev-dependencies] +test = [ + { name = "hypothesis" }, +] + [package.metadata] requires-dist = [ { name = "dill", marker = "python_full_version < '3.15'", specifier = ">=0.4.1" }, @@ -23,6 +28,9 @@ requires-dist = [ { name = "pydantic", specifier = ">=2,<3" }, ] +[package.metadata.requires-dev] +test = [{ name = "hypothesis", specifier = ">=6" }] + [[package]] name = "annotated-types" version = "0.8.0" @@ -60,6 +68,99 @@ requires-dist = [ ] provides-extras = ["readline", "graph", "profile"] +[[package]] +name = "hypothesis" +version = "6.170.15" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sortedcontainers" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/96/ec/59f14eb701087710888b66bfef2dc8bee9dd4a364c69a732db0cc1d3d2dc/hypothesis-6.170.15.tar.gz", hash = "sha256:a4a57e5fb106ecb29cad37e22e411d957e20d933bfb9fb029e1999b1deb8a0b6", size = 521997, upload-time = "2026-11-06T09:54:57.339Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/84/cf/3b56a81685915f6bf0d67b3a6c1139fd9bd4583066161823834e42b9eaa7/hypothesis-6.170.15-cp311-abi3-macosx_10_12_x86_64.whl", hash = "sha256:db8211e0a56fa29bf9e5d9ff9cd969a91ff4e5ffa8fb4983d3dd788253aeee2c", size = 800537, upload-time = "2026-11-06T09:53:36.823Z" }, + { url = "https://files.pythonhosted.org/packages/b6/09/477b3233cca8c447a6dc5fcc076a7294a4fdacb615d960695f6970d706dc/hypothesis-6.170.15-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:34e0859a53f20200f39db3f9cd92112eb6034c31dc670e88d56d8725f453562d", size = 795693, upload-time = "2026-11-06T09:54:14.601Z" }, + { url = "https://files.pythonhosted.org/packages/7c/7a/34e042f1545472abe29ecf9eebac6f748096580f6fb831817f097addbe29/hypothesis-6.170.15-cp311-abi3-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:5c5980821384206939c1c9d519b7adfb80b54d07e669ab0d36fe877f08cff07a", size = 1162432, upload-time = "2026-11-06T09:53:55.461Z" }, + { url = "https://files.pythonhosted.org/packages/3a/7f/95b7b04d2b7e45669db446ee10d97f5d04b143bba380559a7f3a7e0c5b1f/hypothesis-6.170.15-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f29339b5cd4c2a221885e8b7ddbd447b4dc7ee14f763a6f5aaff726d4d3fd5ed", size = 1124598, upload-time = "2026-11-06T09:54:26.015Z" }, + { url = "https://files.pythonhosted.org/packages/33/8e/896172d9706bfe2e09c9154fecb11c7b76e50014442783dd9d5b404c8c84/hypothesis-6.170.15-cp311-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:d836a61c3dd94c6fc4677f4d0d95d30b92eb0ceab6f2b5c58e35c32545583170", size = 1155097, upload-time = "2026-11-06T09:54:47.123Z" }, + { url = "https://files.pythonhosted.org/packages/29/33/b8791c6a9b4232c3cc8f592d3e36175bcb4bad6203f7e461db0a4f5fa11b/hypothesis-6.170.15-cp311-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:d18ffd069360589a66ed125db62f12b490b3b9f6d47e5fd2505f1089d63a0f17", size = 1148988, upload-time = "2026-11-06T09:54:33.101Z" }, + { url = "https://files.pythonhosted.org/packages/87/2c/3ee87dd6fdec16ce55a4aeb5f72ae24756855cdc4ee87637fb68c4daeadc/hypothesis-6.170.15-cp311-abi3-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:7636424c7b1477fdd279fce5a210b67687a3024ac7759fe2e46a767a76f8761c", size = 1201778, upload-time = "2026-11-06T09:53:49.736Z" }, + { url = "https://files.pythonhosted.org/packages/6b/6a/f2757fde7d1b3b5dda6df3441d346b59c60627f2c216d966739289149903/hypothesis-6.170.15-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:99a1a4711b5276e5bfc3aa0cca034d0e45f8696a46ac8dce008308f580c18234", size = 1168007, upload-time = "2026-11-06T09:54:34.331Z" }, + { url = "https://files.pythonhosted.org/packages/8d/79/b6ff2a2840e4bcdea5c4cf1bcdd3803954a632beec16cb9d77a9ee8ddbb8/hypothesis-6.170.15-cp311-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:f545a04342a53008fa696a0592f0a026278ee61fab04f3e9e395d0c7eba42fef", size = 1124154, upload-time = "2026-11-06T09:53:24.354Z" }, + { url = "https://files.pythonhosted.org/packages/52/d0/19bc4a98e9583936dbe6e754014ad1133d3a43c9068a880c4e91ce384fad/hypothesis-6.170.15-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1f11d685322a56ee73c2a7566ec9d1195740313c3b965bad3121c340ec0e657b", size = 1299503, upload-time = "2026-11-06T09:53:12.86Z" }, + { url = "https://files.pythonhosted.org/packages/ee/06/fad2d1546c08eb4133f9478716bf6bc5f881e0d06b5b4f1faf34fd515a5a/hypothesis-6.170.15-cp311-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:f6d5d34fa6b56f236ad9659043123efb85391a8a5640f067c9de82b0be0bff73", size = 1428191, upload-time = "2026-11-06T09:54:44.43Z" }, + { url = "https://files.pythonhosted.org/packages/ca/cd/71d43284cca9c5145ceae04ddac1adfc57e9da57cf8efd30c0876844c9bf/hypothesis-6.170.15-cp311-abi3-musllinux_1_2_i686.whl", hash = "sha256:2ff9983a58647b03754fa3d1005e59a9c563e15256340fc062b4a34c7969d52a", size = 1382322, upload-time = "2026-11-06T09:54:06.405Z" }, + { url = "https://files.pythonhosted.org/packages/0f/56/5754189cd709d4eb34601f8ebb57f1d2381b2dd74f62352ba6b84bce4a12/hypothesis-6.170.15-cp311-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:6e461d7b392a630593134611ebb1fce6baba88dbbf4f07661a37ff58ff4e1b6a", size = 1278225, upload-time = "2026-11-06T09:52:59.772Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a9/5224ea74356981f01222c42f0acc55821fb5aadf3f1f15adc797c7eefbd2/hypothesis-6.170.15-cp311-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:62c0675a837bbe0f3f7c7a89b701bee159759840c23b9bec9d565d3434fb0b3a", size = 1294018, upload-time = "2026-11-06T09:54:29.127Z" }, + { url = "https://files.pythonhosted.org/packages/9d/c5/297f16660b15eacb2872af9fb127e7fe83f48f6f9caf223cb5abd5a25bd8/hypothesis-6.170.15-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:124b0b9962ff6b25786692b7b6cb0065f8bb7870081ddd9baf4745b0ff4a5c7a", size = 1333737, upload-time = "2026-11-06T09:54:03.427Z" }, + { url = "https://files.pythonhosted.org/packages/19/18/7e35ba1bc1f0e3ec55d9d97864db42b5ffeea92766ae4bd7ced0f77cc930/hypothesis-6.170.15-cp311-abi3-win32.whl", hash = "sha256:d34e54f485777eb217c85c425ddbe7b278ef56540feedb5de4097a5abc9f5719", size = 687717, upload-time = "2026-11-06T09:54:40.259Z" }, + { url = "https://files.pythonhosted.org/packages/fa/d6/c16f5abdb56baa2d401de38c2f758090796c1716fed9aa690179772e6adf/hypothesis-6.170.15-cp311-abi3-win_amd64.whl", hash = "sha256:de9fe573a4955b0cf0354822fbfe9b79882e8de02f26287313fe1ad47ba3e69f", size = 693782, upload-time = "2026-11-06T09:53:17.157Z" }, + { url = "https://files.pythonhosted.org/packages/13/7a/ae3b7fdd44c30b662f27344ccb810d080d11b7f557c2cffa88d01e677295/hypothesis-6.170.15-cp311-abi3-win_arm64.whl", hash = "sha256:de5e11c568fd411a3cf07e4e34d4f8cf07d638de2f254c8bd87c1879679cdd9a", size = 692109, upload-time = "2026-11-06T09:53:52.599Z" }, + { url = "https://files.pythonhosted.org/packages/22/fa/4f61c0e5487d75d9ef20bb6d7b9e13b5aabf89d249896d9af0a648578be7/hypothesis-6.170.15-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:679635cd52626790214f879a8bdbb877923333fbd18905c591af41bd74d2f8db", size = 801251, upload-time = "2026-11-06T09:53:45.982Z" }, + { url = "https://files.pythonhosted.org/packages/51/c2/8eb51b3b243248fc7289b37aa78caeff847b98e7a35ba6f6e12a846d68ec/hypothesis-6.170.15-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f95b532f23bed43ef3c45fbd19baf4717687a4993fa6f42fc704fbde18bd744c", size = 796937, upload-time = "2026-11-06T09:54:31.637Z" }, + { url = "https://files.pythonhosted.org/packages/af/fe/80d94b0366d3408078c32758f7149592fdf963d431e52188728e5380d806/hypothesis-6.170.15-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9f5937e70c636ee46bd2242d9ef120d19744e63ce7d17a92fd4c9f57ef62b1c3", size = 1125542, upload-time = "2026-11-06T09:54:16.018Z" }, + { url = "https://files.pythonhosted.org/packages/fd/b4/c9dfacdfa074ebcee35ad8d9e6436480a45b543bd42ab92fa556e3bee113/hypothesis-6.170.15-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ecbd6294a636594580689debc3011a0ca3eb76577770f661224314202f107e14", size = 1168312, upload-time = "2026-11-06T09:53:22.993Z" }, + { url = "https://files.pythonhosted.org/packages/66/dd/29996ba7a8ef7eaea1493dffda4bfb04e85180a2f45d3d9ab7793ada3722/hypothesis-6.170.15-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:efaee8533a06b6a2382ff7c336ea5a747c1b22a4e97c19bfe825a02388f56d2d", size = 1300279, upload-time = "2026-11-06T09:54:30.502Z" }, + { url = "https://files.pythonhosted.org/packages/57/2d/b4be9bbb76ac5079af9cd5cf484e3e0ad91f60a7e98c69d56ac623d55573/hypothesis-6.170.15-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4af2d31c00306707166b4f39e5208d2585f9ef4accb10586534101eb32f243fb", size = 1334296, upload-time = "2026-11-06T09:53:08.948Z" }, + { url = "https://files.pythonhosted.org/packages/69/55/f0677edf64249c5d91ae9387678bfd43ae0f54905fd2a4dbede9cbaf1e0e/hypothesis-6.170.15-cp311-cp311-win_amd64.whl", hash = "sha256:b48cb85180255ec3eb3b3e5d49068c9ad447b25e34fccafdabae63d2c3d854ad", size = 693893, upload-time = "2026-11-06T09:54:49.687Z" }, + { url = "https://files.pythonhosted.org/packages/91/db/84d418c965fe889d21e7791f946f7c893bf492bcedb38f3f5b8eb405a035/hypothesis-6.170.15-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:29223a2d180e463f1205b7e5eb397db0c4827de06f2ae571b00c392d355c410e", size = 802327, upload-time = "2026-11-06T09:54:20.994Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8f/63d8644162728ba8b2c8a8a8b6a34476663c964cc0f6885c19f84ead40d6/hypothesis-6.170.15-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7953ad8f123b4289801b833666aaab757ba52e91ed687d954eb26f4af7328e5b", size = 794302, upload-time = "2026-11-06T09:54:24.828Z" }, + { url = "https://files.pythonhosted.org/packages/ec/2e/d479c69c08d5aabd7e6499f3dddc22b241db42922d746d05df9548213229/hypothesis-6.170.15-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b1f37920547eafa77814bc9b638e47299562123023bdf3c9cb002795bb90fc92", size = 1123978, upload-time = "2026-11-06T09:54:36.215Z" }, + { url = "https://files.pythonhosted.org/packages/ee/e2/824c524d04152e5c26111247d2d4dbf210d43df7c6612f7ff22c20de5abc/hypothesis-6.170.15-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e9e20ec17d2095e9314ea232b4e34b5510def0d9e7a7e764cc70cae88fe4b0c4", size = 1167677, upload-time = "2026-11-06T09:54:55.123Z" }, + { url = "https://files.pythonhosted.org/packages/ce/49/4aab201f1fd0109560d985076a4c852c1abda14984470369bf29ea89ade3/hypothesis-6.170.15-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:11c541cf103c784306f6037e5ab962cbe3d5891d36fd98df993f38d7ddbcd360", size = 1298862, upload-time = "2026-11-06T09:53:51.237Z" }, + { url = "https://files.pythonhosted.org/packages/db/a7/83fc4ef9484deefd955949a9a72a14d9435b6ace339feb27de25bf286e29/hypothesis-6.170.15-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:eecdcd38395facf6ea3af90320a574f5e63c310c194d2a0eb75f121223942386", size = 1333300, upload-time = "2026-11-06T09:53:39.58Z" }, + { url = "https://files.pythonhosted.org/packages/d5/18/5f1a5ce07a9e6b7a2cbfb6a8bceb9b5161de5477abb8d99d659a898b7554/hypothesis-6.170.15-cp312-cp312-win_amd64.whl", hash = "sha256:7dfb3d92df4faa67d3c975d1ecdefabc5a2481b789048f52cd5fb775c6c517b8", size = 691422, upload-time = "2026-11-06T09:54:05.043Z" }, + { url = "https://files.pythonhosted.org/packages/16/16/d75485989f250dd5017d1627902961c2f985686355f50d10170a2490d970/hypothesis-6.170.15-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:e3f478d4d9e13d528e352a4d938dea10b25793663ac752d774d7d35b008a1b45", size = 802290, upload-time = "2026-11-06T09:53:33.892Z" }, + { url = "https://files.pythonhosted.org/packages/24/45/54e42ac718e1164090c04b588024e4818a8e2a28b9002faa21e9fd59ab67/hypothesis-6.170.15-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9c92af3f0c8844d9eba793a4371035a45e88bb59579a1408ce5d3cceb9e2b1da", size = 794293, upload-time = "2026-11-06T09:54:09.14Z" }, + { url = "https://files.pythonhosted.org/packages/b8/ee/1a81a7d544e321165159a07e666f6c302ec109beccca3b37f8d0de54e0cd/hypothesis-6.170.15-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:dce4d989f6b9c0a589b944591f13de3dff34e186c14401e11b819fed81d70a5b", size = 1123881, upload-time = "2026-11-06T09:53:01.454Z" }, + { url = "https://files.pythonhosted.org/packages/c9/07/4d506b2e37601ec8b38a0c4b8f547dd344bd8eccd577dbd0543a744fce03/hypothesis-6.170.15-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f25261d1656f830a78863844be5fb55cd0208154dc9ddec85d44fe691488c557", size = 1167605, upload-time = "2026-11-06T09:53:32.309Z" }, + { url = "https://files.pythonhosted.org/packages/a5/77/a88824d02272f149870e36aaad0197dc5a186f53a1896ea3117f250b8414/hypothesis-6.170.15-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5ae92fa40b57c1cd331d63fe6f95aecfdb6aa32f15b4c418c108c41fcd4aef84", size = 1298841, upload-time = "2026-11-06T09:53:15.809Z" }, + { url = "https://files.pythonhosted.org/packages/68/b9/6e1b55b6b32926cebb7ef37076d8fda9d0f87045e90e4b75e93eeb9a56ac/hypothesis-6.170.15-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b829dc3cbd73fe08c02151afc438448180907da62c154cfa68abd178eafd4d48", size = 1333319, upload-time = "2026-11-06T09:52:57.279Z" }, + { url = "https://files.pythonhosted.org/packages/c8/77/7d2009c663eb26b329c622091f7593ee6c90eac663f389fdf7311d44b035/hypothesis-6.170.15-cp313-cp313-win_amd64.whl", hash = "sha256:1f7ede44b875dddd8f3e7562e6702c363e82c6fb680b0fe079536bae662987f8", size = 691393, upload-time = "2026-11-06T09:54:56.287Z" }, + { url = "https://files.pythonhosted.org/packages/96/85/977d43b789fe4ca530e76020bbd2db07a9af3c17a4bf27a276416b6540e5/hypothesis-6.170.15-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:ffac67d06f765fd000a132e71117ee92dbd59863cea18403220ca4e39b50397f", size = 802549, upload-time = "2026-11-06T09:54:17.455Z" }, + { url = "https://files.pythonhosted.org/packages/cb/1a/51e637155a8c897774463389f1341ec8d466a9860cf5e004689866c557b2/hypothesis-6.170.15-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:82b613ee882068e781d810eb73a8195b59edd6cc47e8acbe4971562044a99c83", size = 794333, upload-time = "2026-11-06T09:54:27.915Z" }, + { url = "https://files.pythonhosted.org/packages/24/c1/ea255465b482ba5fc5f678e4347d6c6bbe878c827ca652d634328be96534/hypothesis-6.170.15-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:eb6fe3d1cb91d4f14fd307f10ae969ef7e866c16e4010a750d1cade145dfd764", size = 1124402, upload-time = "2026-11-06T09:53:02.773Z" }, + { url = "https://files.pythonhosted.org/packages/7a/69/32a05f0ae41f699f30ff872be74fe46ee1d45ead7abfb114afe3a4b4a3ee/hypothesis-6.170.15-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f91f27a89e8d55c7f043cb1e10705096236d4f7bcb35f3ac4f821e0c9b9bcd05", size = 1167795, upload-time = "2026-11-06T09:54:00.357Z" }, + { url = "https://files.pythonhosted.org/packages/c2/fb/c16886cea3a7ae3045093480775eb058eed549f41aa0e21a8d96aa7d51b1/hypothesis-6.170.15-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e0e4ab687c0f2bd62b7963dc8c3c8d29211cdc6db7ce05d37ef2a20d21219c18", size = 1299361, upload-time = "2026-11-06T09:53:04.441Z" }, + { url = "https://files.pythonhosted.org/packages/b7/f3/ad57518f76503276c896388affeccca1ffb1cccc529d063dac588c4bb652/hypothesis-6.170.15-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b01d130c103fdf78a4a748cae7d095edfe5d37534828413a509936fb3567db61", size = 1333515, upload-time = "2026-11-06T09:53:18.642Z" }, + { url = "https://files.pythonhosted.org/packages/2b/08/500fbe05990d886d4502fa334f6cf03607be473b2a2efffb660238135f05/hypothesis-6.170.15-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:1138c03edf4c4401afb28e50255644b4ab4e1ad52864456cd4e84458ba8c671a", size = 634104, upload-time = "2026-11-06T09:54:22.317Z" }, + { url = "https://files.pythonhosted.org/packages/41/53/11e3260a72024f41246061ad204627f8336bfbf0ec2b180648d01a05491f/hypothesis-6.170.15-cp314-cp314-win_amd64.whl", hash = "sha256:57ae2617424f5bb55af0146b47e0aff64a9d6677a4d5216cf2a66bd3bda0d457", size = 691115, upload-time = "2026-11-06T09:53:41.223Z" }, + { url = "https://files.pythonhosted.org/packages/ba/41/655fca0f45b7ea6df6b5bb70ab52b740cc6bc30b971366036eddd36a77c9/hypothesis-6.170.15-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:c0514f3f8ab5d56103b756317dedc8476945b0633e51112312247e3caecd0eb2", size = 800640, upload-time = "2026-11-06T09:53:05.61Z" }, + { url = "https://files.pythonhosted.org/packages/a5/89/6bf52da8b15846c7263eac9fcffb89cc1d1c82f96ca5b839a0d00bb3aa3a/hypothesis-6.170.15-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:cc5434cde3b22c900dfe01f891804b48f6e2aa93e891ca98a14c07dd04fa6d54", size = 792915, upload-time = "2026-11-06T09:53:11.508Z" }, + { url = "https://files.pythonhosted.org/packages/11/f9/a0c2a356c7a3a4b65ec2f80382c9ea5acc1a86247ac64ecb1b7dfc38ee95/hypothesis-6.170.15-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f22900eec7df2696073c05f60c666654eaa93f17aebe8964f751d75b131dcd90", size = 1122841, upload-time = "2026-11-06T09:53:21.626Z" }, + { url = "https://files.pythonhosted.org/packages/ef/f1/d4fa867fae5a733e4041720622417804bcfb79c00d265c5451243a5aba20/hypothesis-6.170.15-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7288412dfba6b5a6f875279a25409eda6b25d097c26ea710540f904287c55d06", size = 1166715, upload-time = "2026-11-06T09:54:42.908Z" }, + { url = "https://files.pythonhosted.org/packages/04/5d/cbf8acf14caa5a2e4d34dd088a507cc84da49a660b6f532104d8afdb2903/hypothesis-6.170.15-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7d546a5d6a5549a6b34304f7315d20aff7afd206996592329877da529b9d9153", size = 1297608, upload-time = "2026-11-06T09:53:29.22Z" }, + { url = "https://files.pythonhosted.org/packages/9c/a0/912a0ebf3ab19b39235233f9e1664147f6e842aa6915828d68c1d1e13f27/hypothesis-6.170.15-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:bd8b36d0403eff6473686c0e4d8b7704780ebf548b0b2cc86cb9cbbbe64f8c2f", size = 1332521, upload-time = "2026-11-06T09:53:47.664Z" }, + { url = "https://files.pythonhosted.org/packages/37/36/d9286c792272651db4059a3497a19cc7f4f60e0452c862274d506b0132fd/hypothesis-6.170.15-cp314-cp314t-win_amd64.whl", hash = "sha256:67eb006925a3a49ddc4a48d9af8314349291a7eee9b2baea6beb93bc48211ead", size = 691229, upload-time = "2026-11-06T09:54:45.888Z" }, + { url = "https://files.pythonhosted.org/packages/91/42/b152b66db2061b47ff928efc7162c2dcf4591d92dab19b3c574af3552220/hypothesis-6.170.15-cp315-abi3.abi3t-macosx_10_12_x86_64.whl", hash = "sha256:e007ff1dfb8bfa228b97ed6695325cfa1ba6487c7e1175c884e8795e71fb41a5", size = 800291, upload-time = "2026-11-06T09:54:07.899Z" }, + { url = "https://files.pythonhosted.org/packages/67/6f/49fe04f0b4cfd142d474e08a1855ea093c7367e6ff33e7c5d4a64592f743/hypothesis-6.170.15-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:742846b0e2e31640acf8bba7c2b8b6eb9cecd6817a906af6d4b5ced9db697660", size = 792763, upload-time = "2026-11-06T09:54:51.025Z" }, + { url = "https://files.pythonhosted.org/packages/88/e6/61ec7fb3b84dd8d8644d6a322d5dba4501e2f32d0b10b8b5467e7d6defd4/hypothesis-6.170.15-cp315-abi3.abi3t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:508488dd4e92e03ecd16ea086f33d766855ed1febd322a439ec231c920b1740a", size = 1158761, upload-time = "2026-11-06T09:54:02.105Z" }, + { url = "https://files.pythonhosted.org/packages/8d/ae/c9eb63eb1b2d935551494aa42ecf91bb214d89c52631854dfbb09ccb6d39/hypothesis-6.170.15-cp315-abi3.abi3t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ccc6a9ce18dced7f0d2cba36f334f44697c1c6e692949c1bbd0bc67a7065c86a", size = 1121659, upload-time = "2026-11-06T09:54:12.041Z" }, + { url = "https://files.pythonhosted.org/packages/0a/44/b99e644480a31153de52489dc4c062df5f82a10fbb2b699d0f17ecb08171/hypothesis-6.170.15-cp315-abi3.abi3t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:b8a0b5b3e21a1d2e235f42a813fbf04872196ad53151fdd4cfe02723db699f8d", size = 1152560, upload-time = "2026-11-06T09:54:41.478Z" }, + { url = "https://files.pythonhosted.org/packages/f8/0a/bfc1c697f34e395d635f49d2a29f1bfc41a0eccdcf9fba32fb33601325de/hypothesis-6.170.15-cp315-abi3.abi3t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:b59187094929ce6d5351a6f92e7f3831cd463fe69591def6ebd0023a3073af2e", size = 1146287, upload-time = "2026-11-06T09:53:42.894Z" }, + { url = "https://files.pythonhosted.org/packages/bb/69/90fac02af55ccbea1d1b3bbc72512c4f998e3fabc6b375c8c0afd0e6003f/hypothesis-6.170.15-cp315-abi3.abi3t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:0ecf4e2948c3de57ea12d66f6cf6c0e3ad88b5eae0d216cfa2922800ba5522a7", size = 1200042, upload-time = "2026-11-06T09:54:37.409Z" }, + { url = "https://files.pythonhosted.org/packages/f8/eb/6810206ee4864b39da6e81b2318516773d5a89b0e2132c00dfc9aa760179/hypothesis-6.170.15-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:55e3dcd5d8fbfd5a97018ff2712f375148b62ef537490c281a198977f3588578", size = 1165971, upload-time = "2026-11-06T09:53:25.72Z" }, + { url = "https://files.pythonhosted.org/packages/e1/c8/ebfb57d277e571c207d690efa56462f1f582721e5170bb86af42c3f97b07/hypothesis-6.170.15-cp315-abi3.abi3t-manylinux_2_31_riscv64.whl", hash = "sha256:417fe54775f846fa4903bb2094ce3092a0ecc107db6676b21fd8069fcc328cb9", size = 1120269, upload-time = "2026-11-06T09:53:56.767Z" }, + { url = "https://files.pythonhosted.org/packages/8a/2b/69dff10b56fbc21dc0d240de503d741ec14cb6819f67530bca0b6ff7c5af/hypothesis-6.170.15-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:47438186039fcfba3a245bb407490d442ce2c9cce4370565f1bfcdcb887e91e2", size = 1296436, upload-time = "2026-11-06T09:53:54.24Z" }, + { url = "https://files.pythonhosted.org/packages/5f/43/42b037bb17dca205f5953b11792ecc2c73dbf7ec743d5dc490d010edb9b0/hypothesis-6.170.15-cp315-abi3.abi3t-musllinux_1_2_armv7l.whl", hash = "sha256:372b05075d4a259c5ebf3fcf43dc689ef5d4335bed9d0c9dd25d14997842c0c0", size = 1425535, upload-time = "2026-11-06T09:53:27.106Z" }, + { url = "https://files.pythonhosted.org/packages/a8/29/bb3050f958b0e3156909011afdcc07812b58a47eba50f53a39d931c1256b/hypothesis-6.170.15-cp315-abi3.abi3t-musllinux_1_2_i686.whl", hash = "sha256:2161fb65416bf8da3b1c3119aa92ea63cc177fd88249bf7dc4ca64b4872e0bd1", size = 1379162, upload-time = "2026-11-06T09:54:23.523Z" }, + { url = "https://files.pythonhosted.org/packages/a5/db/30a2291c92cd437b0c8184bcead204add93d174a1317894dc50ddd3a681d/hypothesis-6.170.15-cp315-abi3.abi3t-musllinux_1_2_ppc64le.whl", hash = "sha256:b3db4c8aecd13e043c419d90ccb683fdf19711b547ca9d23e685a35157d4657f", size = 1274757, upload-time = "2026-11-06T09:54:38.796Z" }, + { url = "https://files.pythonhosted.org/packages/a5/0a/5e1bf0060a1f9486f6cad2b512b5101526dc376565eb669c20964ccee730/hypothesis-6.170.15-cp315-abi3.abi3t-musllinux_1_2_riscv64.whl", hash = "sha256:3b81f08d6052ac74f479215029e253d88fb80e9867e8bc034252d345abfa94ce", size = 1292003, upload-time = "2026-11-06T09:53:14.207Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b9/9d18977c7ec9fa0d0fb22f0e52b3a270fef7b8251579d46660fca285e289/hypothesis-6.170.15-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:a51297c26ab637a97ec3283a39de163efce0a926d0ccd4378faabf5994adb01f", size = 1331925, upload-time = "2026-11-06T09:54:53.632Z" }, + { url = "https://files.pythonhosted.org/packages/ff/af/a86d51e4550c92a794777a59a9332d135c975c6f6c25b7506c447c3be27e/hypothesis-6.170.15-cp315-abi3.abi3t-win32.whl", hash = "sha256:51246e702c458b42a4b5079c3e6904c9dfb5193de920ed91fdbfa09fa694c55b", size = 685060, upload-time = "2026-11-06T09:53:35.48Z" }, + { url = "https://files.pythonhosted.org/packages/dc/3d/ef64b33ef8c5eceb7448860b77bc1d28e3e3b3e92b7d662456fee227f4b0/hypothesis-6.170.15-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:a951de05b61b7c1235a732543dc6c3b105b6c894e736f21cb891449589aaeba7", size = 691031, upload-time = "2026-11-06T09:53:10.201Z" }, + { url = "https://files.pythonhosted.org/packages/e8/3d/f875573e232550be631b6932f93bd6b2234d880891394fe4d70d57e292b7/hypothesis-6.170.15-cp315-abi3.abi3t-win_arm64.whl", hash = "sha256:9dc31166ccb95928c6eb05817684b2dd1c2a3698a6daad0450e5f449e44bb633", size = 689008, upload-time = "2026-11-06T09:54:13.194Z" }, + { url = "https://files.pythonhosted.org/packages/4d/f4/34e1ca38f88cbf478f970b7743ea022e0d70d5b4e943eea7c06532aea6b0/hypothesis-6.170.15-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:bfe10cd8c8138ba84cdd0f72d72e0a85f0f9adea8bc730f4ab4676cd41a730af", size = 801079, upload-time = "2026-11-06T09:53:19.956Z" }, + { url = "https://files.pythonhosted.org/packages/6d/8b/3438b357b3f6e076ff3f68aee5a62c1319573c4858b9f9db6e12e2893fca/hypothesis-6.170.15-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:5c1331070d8688d31b9ce99a100593bc6afdada964689b5e1a5f2ecffefa2455", size = 795993, upload-time = "2026-11-06T09:54:52.505Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a7/f25cc6ec59659ef59093ffa743a2494cc153bb8a8eeeb78e1c1e58720888/hypothesis-6.170.15-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b56ea17542eabcb9e2c1d574fcabc9df7e14a7376cfce324e2fa05e9c836fff8", size = 1125066, upload-time = "2026-11-06T09:54:19.213Z" }, + { url = "https://files.pythonhosted.org/packages/a9/c3/4b58275fe5771859bd03fe5ceccee64968874fdb999c549abf7ae7f716b9/hypothesis-6.170.15-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1c3b98713318639a6c852f3fff60bddd466096528eb2cd5853ab077ef04f74c", size = 1168451, upload-time = "2026-11-06T09:53:38.214Z" }, + { url = "https://files.pythonhosted.org/packages/dd/b8/c935e11303f94a6e280e059aedc7c5a6458207f7039aa241d2504e178c53/hypothesis-6.170.15-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:7ea75bc4c55f0ebb80179ae7e8fe1c8ab09b553005d1aadcec14e97e1306a82a", size = 694365, upload-time = "2026-11-06T09:53:59.021Z" }, + { url = "https://files.pythonhosted.org/packages/3b/54/ab7c9a7581b0acaeb58850629f4772aab054f2fd6a77bd3264262dfb1156/hypothesis-6.170.15-pp312-pypy312_pp80-macosx_10_12_x86_64.whl", hash = "sha256:45c267cb5bcd7b73b1ca6cedb039de423b8695b34a31cc87c29a7787058e7e59", size = 801399, upload-time = "2026-11-06T09:54:10.562Z" }, + { url = "https://files.pythonhosted.org/packages/fe/a6/a7dfce075d7371c9951e2a69e78d93bff5099d1b7b0ca207497eed68428b/hypothesis-6.170.15-pp312-pypy312_pp80-macosx_11_0_arm64.whl", hash = "sha256:3eb9428e0ba92993b61cab0289b8450f469b1e4c56cbdbdeaad258f0fb4f107e", size = 793309, upload-time = "2026-11-06T09:53:07.629Z" }, + { url = "https://files.pythonhosted.org/packages/6f/b4/ce76691a588dca99c73116593b2514af2d0095e7e72d3bcdfb7dcecf2170/hypothesis-6.170.15-pp312-pypy312_pp80-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9c30c911be51aa4fa84706f1d79dcd9ad6b9728207e69667a3fed2d4ab711434", size = 1123240, upload-time = "2026-11-06T09:53:44.286Z" }, + { url = "https://files.pythonhosted.org/packages/52/a7/998ba78de4842158178f6d96eca52ec1c786548b3e08902d527469329c04/hypothesis-6.170.15-pp312-pypy312_pp80-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d2b68004bd5a238320569f7c03322b22815c2c145b1f7bbf52a319662570ee5c", size = 1167454, upload-time = "2026-11-06T09:54:48.426Z" }, + { url = "https://files.pythonhosted.org/packages/03/f5/410ff24a49dd645f651732f45e466cbb73f4bb73d1c54eaa5a07b832b0a2/hypothesis-6.170.15-pp312-pypy312_pp80-win_amd64.whl", hash = "sha256:d25e9a3f92e9f824bb110679506ece2b8fd7d093f1fa7d819ca46278a681a1f1", size = 692539, upload-time = "2026-11-06T09:53:30.812Z" }, +] + [[package]] name = "pydantic" version = "2.14.4" @@ -82,6 +183,7 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] +sdist = { url = "https://files.pythonhosted.org/packages/fb/63/0ceb815a7762576027ce388544c573d440574f95afb1302a2496b96db548/pydantic_core-2.50.5.tar.gz", hash = "sha256:1e740886083ff95530d694e6a3f09ed914bcf92a496d16acd307c6c3484fc36d", size = 523285, upload-time = "2026-11-19T12:56:38.067Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/2e/13/38388fd381879499d83dec38826fdb9457ab67b77f6e32c2dddcfc604dae/pydantic_core-2.50.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:bcc830e4f48499fd30a870f07c30752273ae2ddccce34d65d51c9fc880c380ab", size = 2173303, upload-time = "2026-11-19T12:53:40.749Z" }, { url = "https://files.pythonhosted.org/packages/e6/3b/8b75df5dbcd09d81e536edc17d1d77767a4044fa5b90cf875c4100bb7ce7/pydantic_core-2.50.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:40d5da89a632e6c6c938f93fdf54c534882d258a80f51ccfe1650cdedc12e82c", size = 2135436, upload-time = "2026-11-19T12:53:42.276Z" }, @@ -210,6 +312,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/78/85/8c9120a1910ace8990fdfecbf9beb785e7d642fff94281df2df2b5735a16/pydantic_core-2.50.5-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:b6f48c4bf1c77ace644b125f168418438fbc9b8e4c3b290915cc7d055d83c8b1", size = 2339507, upload-time = "2026-11-19T12:56:36.826Z" }, ] +[[package]] +name = "sortedcontainers" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/c4/ba2f8066cceb6f23394729afe52f3bf7adec04bf9ed2c820b39e19299111/sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", size = 30594, upload-time = "2021-05-16T22:03:42.897Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0", size = 29575, upload-time = "2021-05-16T22:03:41.177Z" }, +] + [[package]] name = "typing-extensions" version = "4.16.0" diff --git a/test/hypothesis_profiles.py b/test/hypothesis_profiles.py new file mode 100644 index 000000000..3f2b62aab --- /dev/null +++ b/test/hypothesis_profiles.py @@ -0,0 +1,71 @@ +"""Hypothesis under the repository's seed and budget convention. + +Importing this module registers two settings profiles and loads one +(robot-docs/testing.md#seeds-and-budgets): + +- ``gate``, when ``ALBEDO_PROPERTY_SEED`` is unset: derandomized, so every run + tries the same examples, with no example database. +- ``discovery``, when it is ``random`` or an integer: fresh examples, and + failures kept in an example database under the scratch root + (``$ALBEDO_TEST_TMP/hypothesis``), never in the tree. An integer seed + replays exactly that run. + +``ALBEDO_PROPERTY_CASES`` sets ``max_examples``. A test that needs a smaller +gate budget passes ``@settings(max_examples=cases(n))``, which the variable +still overrides. Both profiles print the reproduction blob with the shrunk +example, and a random run prints its ``@seed``, so the log alone reproduces a +failure. Commit each shrunk counterexample as a named example test. +""" + +import os +from pathlib import Path + +from hypothesis import core, settings +from hypothesis.database import DirectoryBasedExampleDatabase + +GATE_CASES = 100 +DISCOVERY_CASES = 2000 +ROOT = Path(os.environ.get("ALBEDO_TEST_TMP", "/tmp/albedo-tests")) + + +def cases(gate: int) -> int: + """A test's example budget: ``gate`` unless ``ALBEDO_PROPERTY_CASES`` is set.""" + value = os.environ.get("ALBEDO_PROPERTY_CASES") + return int(value) if value else gate + + +def _load() -> str: + seed = os.environ.get("ALBEDO_PROPERTY_SEED", "") + common = settings(deadline=None, print_blob=True) + settings.register_profile( + "gate", + derandomize=True, + database=None, + max_examples=cases(GATE_CASES), + parent=common, + ) + settings.register_profile( + "discovery", + derandomize=False, + database=DirectoryBasedExampleDatabase(ROOT / "hypothesis"), + max_examples=cases(DISCOVERY_CASES), + parent=common, + ) + if seed == "": + profile = "gate" + elif seed == "random": + profile = "discovery" + elif seed.isdigit(): + profile = "discovery" + # What `pytest --hypothesis-seed` sets. Hypothesis reads no seed from + # the environment, and a forced seed skips the example database. + setattr(core, "global_force_seed", int(seed)) + else: + raise ValueError( + "ALBEDO_PROPERTY_SEED must be unset, 'random', or a non-negative integer" + ) + settings.load_profile(profile) + return profile + + +PROFILE = _load() -- knotmirror 0.0.1