diff --git a/.github/DISCUSSION_TEMPLATE/q-a.yml b/.github/DISCUSSION_TEMPLATE/q-a.yml index 5f9e849..6307720 100644 --- a/.github/DISCUSSION_TEMPLATE/q-a.yml +++ b/.github/DISCUSSION_TEMPLATE/q-a.yml @@ -10,7 +10,7 @@ body: id: package-version attributes: label: Package and version - placeholder: "packvium-native-rust 1.10.0 (Rust)" + placeholder: "packvium-native-rust 1.11.0 (Rust)" validations: required: true - type: textarea diff --git a/.github/DISCUSSION_TEMPLATE/show-and-tell.yml b/.github/DISCUSSION_TEMPLATE/show-and-tell.yml index 0b2fc0b..2e6b026 100644 --- a/.github/DISCUSSION_TEMPLATE/show-and-tell.yml +++ b/.github/DISCUSSION_TEMPLATE/show-and-tell.yml @@ -16,7 +16,7 @@ body: id: package-version attributes: label: Package and version - placeholder: "packvium-native-rust 1.10.0 (Rust)" + placeholder: "packvium-native-rust 1.11.0 (Rust)" validations: required: false - type: textarea diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0252e54..f029186 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -33,8 +33,8 @@ body: id: version attributes: label: Package version - description: The exact version installed, for example 1.10.0. - placeholder: "1.10.0" + description: The exact version installed, for example 1.11.0. + placeholder: "1.11.0" validations: required: true - type: input @@ -101,5 +101,5 @@ body: options: - label: I searched the existing issues and did not find this one. required: true - - label: I read [docs/GUARANTEES.md](https://github.com/toxakara/packvium-native/blob/HEAD/docs/GUARANTEES.md) and this is not something it says the library does not guarantee. + - label: I read [docs/GUARANTEES.md](https://github.com/packvium/packvium-native/blob/HEAD/docs/GUARANTEES.md) and this is not something it says the library does not guarantee. required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 9a99c8f..5a53878 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,10 +1,10 @@ blank_issues_enabled: false contact_links: - name: Question or help with a request - url: https://github.com/toxakara/packvium-native/discussions/categories/q-a + url: https://github.com/packvium/packvium-native/discussions/categories/q-a about: Ask in Discussions → Q&A. Answers there help the next person too. - name: Report a security vulnerability - url: https://github.com/toxakara/packvium-native/security/advisories/new + url: https://github.com/packvium/packvium-native/security/advisories/new about: Report privately. Do not open a public issue for a security problem. - name: Documentation url: https://packvium.com/docs diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 6336594..68785fc 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -29,7 +29,7 @@ body: id: version attributes: label: Package version - placeholder: "1.10.0" + placeholder: "1.11.0" validations: required: true - type: textarea diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb4342..365fa42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ PyPI, `@packvium/native` and its platform packages on npm, and the C library on Releases. The format follows [Keep a Changelog](https://keepachangelog.com/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.11.0] + +The compiled engines rebuilt on the 1.11.0 core: bottom gussets and standing pouches, a +certified bound for `shipping_cost` and `lowest_landed_cost`, one money ceiling (2^53 − 1), +the shared measure grammar, a 32-vertex hull cap, and `effort_budget` limits written as `1000.0` +read as integers. A JSON count of 2^32 no longer truncates to 0 on 32-bit targets. + ## [1.10.0] The compiled engines rebuilt on the 1.10.0 core: a pallet load may overhang its deck, diff --git a/CITATION.cff b/CITATION.cff index 32889b2..6b49cd2 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -5,10 +5,10 @@ type: software authors: - name: "Packvium contributors" website: "https://packvium.com" -version: "1.10.0" +version: "1.11.0" license: MIT url: "https://packvium.com" -repository-code: "https://github.com/toxakara/packvium-native" +repository-code: "https://github.com/packvium/packvium-native" abstract: >- Compiled Rust backend for Packvium, consumed by the packvium-native selector keywords: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1c04ce..189fdf8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ README's table. **No engine changes here.** `crates/packvium-core` is the published engine's source, carried so that every binary is traceable to the commit it was built from. Solver behaviour, constraints and the request format change in -[packvium-rust](https://github.com/toxakara/packvium-rust), where their tests live, and +[packvium-rust](https://github.com/packvium/packvium-rust), where their tests live, and reach this repository from there. **A binding forwards; it does not decide.** `bindings/python`, `bindings/node` and diff --git a/Cargo.lock b/Cargo.lock index 0c53cee..b8e70d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -288,7 +288,7 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "packvium-core" -version = "1.10.0" +version = "1.11.0" dependencies = [ "libc", "serde", @@ -300,7 +300,7 @@ dependencies = [ [[package]] name = "packvium-ffi" -version = "1.10.0" +version = "1.11.0" dependencies = [ "packvium-core", "serde_json", @@ -308,7 +308,7 @@ dependencies = [ [[package]] name = "packvium-node-native" -version = "1.10.0" +version = "1.11.0" dependencies = [ "napi", "napi-build", @@ -318,7 +318,7 @@ dependencies = [ [[package]] name = "packvium-python-native" -version = "1.10.0" +version = "1.11.0" dependencies = [ "packvium-core", "pyo3", diff --git a/Cargo.toml b/Cargo.toml index 097344a..f50af58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,12 +9,12 @@ members = [ default-members = ["crates/packvium-core", "crates/packvium-ffi"] [workspace.package] -version = "1.10.0" +version = "1.11.0" edition = "2024" rust-version = "1.88" license = "MIT" authors = ["Packvium contributors"] -repository = "https://github.com/toxakara/packvium-native" +repository = "https://github.com/packvium/packvium-native" homepage = "https://packvium.com" [workspace.dependencies] @@ -26,4 +26,4 @@ thiserror = "2.0.19" # package hashes too; default features off, it needs nothing from std. sha2 = { version = "0.10.9", default-features = false } web-time = "1.1.0" -packvium-core = { path = "crates/packvium-core", version = "1.10.0" } +packvium-core = { path = "crates/packvium-core", version = "1.11.0" } diff --git a/README.md b/README.md index 7499245..e9abe95 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ repository by its tagged release workflow: | --- | --- | --- | | `packvium-native-rust` — one `abi3` wheel per platform, CPython 3.9+ | [PyPI](https://pypi.org/project/packvium-native-rust/) | [`packvium-native`](https://pypi.org/project/packvium-native/), the Python backend selector | | `@packvium/native` and its four per-platform packages | [npm](https://www.npmjs.com/package/@packvium/native) | [`@packvium/engine`](https://www.npmjs.com/package/@packvium/engine) | -| `packvium-ffi` — the C ABI as a shared library, with [`include/packvium.h`](include/packvium.h) | this repository's GitHub Releases | the [PHP native bridge](https://github.com/toxakara/packvium-php-bridge), and any C-compatible host | +| `packvium-ffi` — the C ABI as a shared library, with [`include/packvium.h`](include/packvium.h) | this repository's GitHub Releases | the [PHP native bridge](https://github.com/packvium/packvium-php-bridge), and any C-compatible host | None of them is meant to be the first thing you install. Each is the fast path behind a package that also works without it, and gives the same answers either way. @@ -46,7 +46,7 @@ Every wheel, npm tarball and shared library is attested by the workflow that bui the GitHub CLI: ```bash -gh attestation verify libpackvium_ffi-x86_64-unknown-linux-gnu.so --repo toxakara/packvium-native +gh attestation verify libpackvium_ffi-x86_64-unknown-linux-gnu.so --repo packvium/packvium-native ``` npm shows the same provenance on each package page, and `npm audit signatures` checks it @@ -98,7 +98,7 @@ attached. No registry token is stored in this repository. Changes are listed in [CHANGELOG.md](CHANGELOG.md). The engine itself is developed in the open in -[packvium-rust](https://github.com/toxakara/packvium-rust); its correctness suite runs +[packvium-rust](https://github.com/packvium/packvium-rust); its correctness suite runs there. This repository holds the same source so that every binary can be traced to the commit it was built from. diff --git a/bindings/node/README.md b/bindings/node/README.md index a52db70..809d2e9 100644 --- a/bindings/node/README.md +++ b/bindings/node/README.md @@ -16,6 +16,6 @@ The loader in `index.js` names every binary it can load by a literal specifier, a binary built for a different release than its own. Every package is published by the tagged release workflow of -[packvium-native](https://github.com/toxakara/packvium-native) with npm provenance. +[packvium-native](https://github.com/packvium/packvium-native) with npm provenance. Documentation: [packvium.com](https://packvium.com). Licence: MIT. diff --git a/bindings/node/index.js b/bindings/node/index.js index d673e71..ad67190 100644 --- a/bindings/node/index.js +++ b/bindings/node/index.js @@ -13,7 +13,7 @@ 'use strict'; /** The release this loader belongs to; a binary from any other release is refused. */ -const EXPECTED_VERSION = '1.10.0'; +const EXPECTED_VERSION = '1.11.0'; function firstLoadable(attempts) { const failures = []; diff --git a/bindings/node/npm/darwin-arm64/package.json b/bindings/node/npm/darwin-arm64/package.json index 22cfb41..85a3ac9 100644 --- a/bindings/node/npm/darwin-arm64/package.json +++ b/bindings/node/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@packvium/native-darwin-arm64", - "version": "1.10.0", + "version": "1.11.0", "cpu": [ "arm64" ], @@ -18,10 +18,10 @@ "homepage": "https://packvium.com", "repository": { "type": "git", - "url": "git+https://github.com/toxakara/packvium-native.git" + "url": "git+https://github.com/packvium/packvium-native.git" }, "bugs": { - "url": "https://github.com/toxakara/packvium-native/issues" + "url": "https://github.com/packvium/packvium-native/issues" }, "license": "MIT", "description": "Compiled Rust engine for @packvium/engine, macOS arm64. Not meant to be installed directly." diff --git a/bindings/node/npm/darwin-x64/package.json b/bindings/node/npm/darwin-x64/package.json index 1b2221a..3a56701 100644 --- a/bindings/node/npm/darwin-x64/package.json +++ b/bindings/node/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@packvium/native-darwin-x64", - "version": "1.10.0", + "version": "1.11.0", "cpu": [ "x64" ], @@ -18,10 +18,10 @@ "homepage": "https://packvium.com", "repository": { "type": "git", - "url": "git+https://github.com/toxakara/packvium-native.git" + "url": "git+https://github.com/packvium/packvium-native.git" }, "bugs": { - "url": "https://github.com/toxakara/packvium-native/issues" + "url": "https://github.com/packvium/packvium-native/issues" }, "license": "MIT", "description": "Compiled Rust engine for @packvium/engine, macOS x86_64. Not meant to be installed directly." diff --git a/bindings/node/npm/linux-x64-gnu/package.json b/bindings/node/npm/linux-x64-gnu/package.json index 3dbd40d..b3d7443 100644 --- a/bindings/node/npm/linux-x64-gnu/package.json +++ b/bindings/node/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@packvium/native-linux-x64-gnu", - "version": "1.10.0", + "version": "1.11.0", "cpu": [ "x64" ], @@ -21,10 +21,10 @@ "homepage": "https://packvium.com", "repository": { "type": "git", - "url": "git+https://github.com/toxakara/packvium-native.git" + "url": "git+https://github.com/packvium/packvium-native.git" }, "bugs": { - "url": "https://github.com/toxakara/packvium-native/issues" + "url": "https://github.com/packvium/packvium-native/issues" }, "license": "MIT", "description": "Compiled Rust engine for @packvium/engine, Linux x86_64 (glibc). Not meant to be installed directly." diff --git a/bindings/node/npm/win32-x64-msvc/package.json b/bindings/node/npm/win32-x64-msvc/package.json index 6e54b33..0485038 100644 --- a/bindings/node/npm/win32-x64-msvc/package.json +++ b/bindings/node/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@packvium/native-win32-x64-msvc", - "version": "1.10.0", + "version": "1.11.0", "cpu": [ "x64" ], @@ -18,10 +18,10 @@ "homepage": "https://packvium.com", "repository": { "type": "git", - "url": "git+https://github.com/toxakara/packvium-native.git" + "url": "git+https://github.com/packvium/packvium-native.git" }, "bugs": { - "url": "https://github.com/toxakara/packvium-native/issues" + "url": "https://github.com/packvium/packvium-native/issues" }, "license": "MIT", "description": "Compiled Rust engine for @packvium/engine, Windows x86_64 (MSVC). Not meant to be installed directly." diff --git a/bindings/node/package.json b/bindings/node/package.json index 38a3d83..d00d372 100644 --- a/bindings/node/package.json +++ b/bindings/node/package.json @@ -1,6 +1,6 @@ { "name": "@packvium/native", - "version": "1.10.0", + "version": "1.11.0", "description": "Compiled Rust engine for @packvium/engine. Not meant to be installed directly.", "license": "MIT", "main": "index.js", @@ -25,15 +25,15 @@ "homepage": "https://packvium.com", "repository": { "type": "git", - "url": "git+https://github.com/toxakara/packvium-native.git" + "url": "git+https://github.com/packvium/packvium-native.git" }, "bugs": { - "url": "https://github.com/toxakara/packvium-native/issues" + "url": "https://github.com/packvium/packvium-native/issues" }, "optionalDependencies": { - "@packvium/native-darwin-arm64": "1.10.0", - "@packvium/native-darwin-x64": "1.10.0", - "@packvium/native-win32-x64-msvc": "1.10.0", - "@packvium/native-linux-x64-gnu": "1.10.0" + "@packvium/native-darwin-arm64": "1.11.0", + "@packvium/native-darwin-x64": "1.11.0", + "@packvium/native-win32-x64-msvc": "1.11.0", + "@packvium/native-linux-x64-gnu": "1.11.0" } } diff --git a/bindings/python/README.md b/bindings/python/README.md index 44ce1e8..1093d25 100644 --- a/bindings/python/README.md +++ b/bindings/python/README.md @@ -13,7 +13,7 @@ pip install 'packvium-native[native]' packvium Wheels are published for Linux (manylinux_2_28, x86_64 and aarch64), macOS (arm64 and x86_64) and Windows (x86_64). Each wheel is built by the tagged release workflow of -[packvium-native](https://github.com/toxakara/packvium-native) and carries a build +[packvium-native](https://github.com/packvium/packvium-native) and carries a build provenance attestation. The module answers the same JSON request contract as every Packvium engine: diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml index 55ef2ac..21acd9e 100644 --- a/bindings/python/pyproject.toml +++ b/bindings/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "packvium-native-rust" -version = "1.10.0" +version = "1.11.0" requires-python = ">=3.9" description = "Compiled Rust backend for Packvium, consumed by the packvium-native selector" readme = "README.md" @@ -15,8 +15,8 @@ authors = [{name = "Packvium contributors"}] [project.urls] Homepage = "https://packvium.com" Documentation = "https://packvium.com/docs" -Source = "https://github.com/toxakara/packvium-native" -Issues = "https://github.com/toxakara/packvium-native/issues" +Source = "https://github.com/packvium/packvium-native" +Issues = "https://github.com/packvium/packvium-native/issues" [tool.maturin] module-name = "packvium_native_rust._packvium_native_rust" diff --git a/codemeta.json b/codemeta.json index 4d4a14a..4d0ea70 100644 --- a/codemeta.json +++ b/codemeta.json @@ -3,7 +3,7 @@ "@type": "SoftwareSourceCode", "name": "Packvium native engines: Python wheels, Node addons and the C library", "description": "Compiled Rust backend for Packvium, consumed by the packvium-native selector", - "version": "1.10.0", + "version": "1.11.0", "license": "https://spdx.org/licenses/MIT", "author": [ { @@ -13,8 +13,8 @@ } ], "url": "https://packvium.com", - "codeRepository": "https://github.com/toxakara/packvium-native", - "issueTracker": "https://github.com/toxakara/packvium-native/issues", + "codeRepository": "https://github.com/packvium/packvium-native", + "issueTracker": "https://github.com/packvium/packvium-native/issues", "programmingLanguage": "Rust", "keywords": [ "3d-bin-packing", diff --git a/crates/packvium-core/src/api.rs b/crates/packvium-core/src/api.rs index cae8e01..1d11fe7 100644 --- a/crates/packvium-core/src/api.rs +++ b/crates/packvium-core/src/api.rs @@ -6,7 +6,7 @@ use crate::geometry::{ALL_DIRECTIONS, Aabb, Dimensions, Point, Rotation, ShapeTy use crate::hull::{self, Vertex}; use crate::made_to_measure::{MAX_EXACT_INTEGER, MadeToMeasure, sides_of}; use crate::model::*; -use crate::pallet_overhang::{OverhangLimit, solving_frame}; +use crate::pallet_overhang::{OverhangLimit, needs_solving_frame, solving_frame}; use crate::policy::{PolicyConstraint, PolicyRuleSet}; use crate::rebalance::rebalance_weight; use crate::request_errors; @@ -64,7 +64,8 @@ pub fn rebalance_json( let request_value: Value = serde_json::from_str(request_input)?; let request = request_from_json(&request_value)?; validate_request(&request)?; - // A result's coordinates are in each pallet's solving frame. + // A result's coordinates are in each pallet's and standing bag's solving frame (, + //). let request = with_solving_frames(&request); let result_value: Value = serde_json::from_str(result_input)?; let original = parse_rebalance_result(&request, &result_value)?; @@ -73,7 +74,7 @@ pub fn rebalance_json( // back a shipment with no published price under the caller's own objective ( // review). Objective-gated inside the helper. if let Some((container_id, grams, bound)) = - crate::solvers::unpriceable_container(&original.containers, &request.config) + crate::billing::unpriceable_container(&original.containers, &request.config) { return Err(PackError::InvalidInput(format!( "container {container_id:?} bills at {grams} g, above its rate table's last \ @@ -417,11 +418,7 @@ pub fn pack_request_with_policy( ) -> PackResult { validate_request(request)?; let framed; - let request = if request - .containers - .iter() - .any(|container| container.pallet_overhang_limit.is_some()) - { + let request = if request.containers.iter().any(needs_solving_frame) { framed = with_solving_frames(request); &framed } else { @@ -479,7 +476,7 @@ pub fn pack_request_with_policy( // the last bracket has no published price, and quoting one anyway is the failure this // objective exists to prevent. if let Some((container_id, grams, bound)) = - crate::solvers::unpriceable_container(&result.containers, &request.config) + crate::billing::unpriceable_container(&result.containers, &request.config) { return Err(PackError::InvalidInput(format!( "container {container_id:?} bills at {grams} g, above its rate table's last \ @@ -491,7 +488,7 @@ pub fn pack_request_with_policy( // ones that never passed through it, and an alternative quoting the sentinel is the // leak by another door. result.alternatives.retain(|alternative| { - crate::solvers::unpriceable_container(&alternative.containers, &request.config).is_none() + crate::billing::unpriceable_container(&alternative.containers, &request.config).is_none() }); warn_unsupported_placements(&mut result, request.config.minimum_support_ratio); state_optimality(&mut result, objective_bound.as_deref()); @@ -1405,8 +1402,10 @@ fn parse_effort_budget(value: Option<&Value>) -> PackResult let field = |name: &str| -> PackResult> { match map.get(name) { None => Ok(None), - Some(value) => value - .as_u64() + // By value, as admission reads it: `1000.0` is the integer 1000 (JavaScript + // cannot tell the two apart), and `as_u64` alone would refuse it. + Some(value) => crate::canonical_json::json_integer(value) + .and_then(|value| u64::try_from(value).ok()) .filter(|value| *value > 0) .map(Some) .ok_or_else(|| { @@ -1418,7 +1417,7 @@ fn parse_effort_budget(value: Option<&Value>) -> PackResult max_candidates_evaluated: field("max_candidates_evaluated")?, max_placement_attempts: field("max_placement_attempts")?, max_search_nodes: field("max_search_nodes")?, - max_restarts: field("max_restarts")?.map(|value| value as usize), + max_restarts: field("max_restarts")?.map(to_usize), })) } @@ -1695,10 +1694,10 @@ fn parse_container(value: &Value, unit: &str) -> PackResult { Some(Value::Object(limits)) => limits .iter() .map(|(tag, value)| { - value - .as_u64() + crate::canonical_json::json_integer(value) + .and_then(|limit| u64::try_from(limit).ok()) .filter(|limit| *limit > 0) - .map(|limit| (tag.clone(), limit as usize)) + .map(|limit| (tag.clone(), to_usize(limit))) .ok_or_else(|| { PackError::InvalidInput(format!( "container.tag_limits.{tag} must be positive" @@ -1723,6 +1722,7 @@ fn parse_container(value: &Value, unit: &str) -> PackResult { made_to_measure: parse_made_to_measure(map.get("made_to_measure"), unit)?, pallet_overhang_limit: parse_pallet_overhang_limit(map.get("pallet_overhang_limit"), unit)?, deck: None, + upright_frame: false, }) } @@ -1771,8 +1771,8 @@ fn parse_made_to_measure(value: Option<&Value>, unit: &str) -> PackResult