Skip to content

Packvium 1.4.0

Choose a tag to compare

@github-actions github-actions released this 27 Sep 21:05
· 7 commits to main since this release
b7b5380

Replanning a job that has already started, a beam search that no longer trades memory for
speed, and container ids that match the other engines.

Added

  • Fixed placements. fixed_placements in a JSON request, or
    PackingRequest.fixed_placements with packvium_core::FixedPlacement. Each entry pins an
    item type to a container type and instance, at the origin a result reports, in one
    orientation. Fixed items keep their place, count toward weight, support and top load, and
    come back marked "fixed": true. A fixed set that is not a valid packing on its own is
    refused with invalid_fixed_placement: ... before any search.
  • packvium_core::revisions — root_revision_json, derive_revision_json,
    apply_events_json, verify_revision_chain_json, document_digest_json and
    canonical_revision_json. A packvium-plan-revision/v1 chain records what happened on the
    dock against the artifact it changed, linked by SHA-256, and carries the request the next
    plan solves. Every Packvium engine computes the same bytes from the same inputs. Errors are
    RevisionError with a RevisionErrorCode.
  • A new dependency, sha2 (RustCrypto, no default features), for the digest.
  • PackError::InvalidRequest(RequestError). A malformed request names what is wrong:
    code() is invalid_request, reason() one of a closed set (missing_field, wrong_type,
    below_minimum, above_maximum, negative_measure, invalid_unit, duplicate_id,
    not_allowed, invalid_value), field() the JSON Pointer of the bad value, and the message
    reads invalid_request: /items/0/quantity: must be at least 1. The fixed-placement refusal is
    a RequestError too, with code invalid_fixed_placement.
  • examples/revisions.rs.

Changed

  • PackError is #[non_exhaustive], and a malformed request is InvalidRequest. It used
    to be InvalidInput, InvalidNumber or UnsupportedUnit with free text. An exhaustive
    match on PackError needs a wildcard arm; formatting the error is unaffected.
  • The container-plan beam keeps 1.3.0's speed without its memory cost. It ranks nodes by
    five integers, compares placement signatures in place only when ranks tie, and orders only
    the nodes it keeps. Results are byte-identical. At equal work it took 0.70× and 0.71× the
    time of 1.3.0's, and peaked at 0.986× and 0.992× of 1.2.0's memory in a Linux container.
  • Container ids number each type from 1. The greedy and beam searches counted containers
    across types, so a crate opened after a box was crate#2 where the other engines said
    crate#1. Only answers with more than one container type change, and only their ids.
  • PackingRequest gains fixed_placements and fixed_containers, Container gains
    preloaded, and Placement gains fixed.
    JSON callers are unaffected. Code that builds
    these structs with a literal must add the fields: empty vectors and false keep 1.3.0's
    behaviour.

Fixed

  • Numbers below their floor are refused. A negative item or container quantity was
    packed, and a zero or negative time_limit_ms, max_containers, max_items,
    alternatives, search width or rate-table amount was silently replaced by its default. Each
    is now an error naming the field; an absent or null value keeps its default.
  • The independent validator checks incompatible tags. It had no incompatible_items rule,
    so an answer with incompatible items in one container passed it. The search already
    enforced the rule, so only a hand-built answer or a fixed set could slip through.
  • A placement or obstacle far outside its container is refused. An origin near the top of
    the integer range overflowed when its extent was added, and the box then looked inside.
  • A fixed placement is refused, never coerced, when it is not the schema's shape. An
    instance of "1" or 1.5, a position given as a list or null, or an unknown key is refused
    naming the entry, instead of falling back to instance 1 or the origin.