Repository navigation
Packvium 1.4.0
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_placementsin a JSON request, or
PackingRequest.fixed_placementswithpackvium_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 withinvalid_fixed_placement: ...before any search. packvium_core::revisions—root_revision_json,derive_revision_json,
apply_events_json,verify_revision_chain_json,document_digest_jsonand
canonical_revision_json. Apackvium-plan-revision/v1chain 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
RevisionErrorwith aRevisionErrorCode.- A new dependency,
sha2(RustCrypto, no default features), for the digest. PackError::InvalidRequest(RequestError). A malformed request names what is wrong:
code()isinvalid_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
readsinvalid_request: /items/0/quantity: must be at least 1. The fixed-placement refusal is
aRequestErrortoo, with codeinvalid_fixed_placement.examples/revisions.rs.
Changed
PackErroris#[non_exhaustive], and a malformed request isInvalidRequest. It used
to beInvalidInput,InvalidNumberorUnsupportedUnitwith free text. An exhaustive
matchonPackErrorneeds 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 wascrate#2where the other engines said
crate#1. Only answers with more than one container type change, and only their ids. PackingRequestgainsfixed_placementsandfixed_containers,Containergains
preloaded, andPlacementgainsfixed. JSON callers are unaffected. Code that builds
these structs with a literal must add the fields: empty vectors andfalsekeep 1.3.0's
behaviour.
Fixed
- Numbers below their floor are refused. A negative item or container quantity was
packed, and a zero or negativetime_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_itemsrule,
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"or1.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.