A translation table for the sentences that recur across the error types
and the simple accessors let the same wording be applied everywhere at
once, which both keeps the Chinese consistent and covers a hundred and
twenty-nine sites in a single pass. Routing, topology, access and the radio
frequency crates are now part of the sweep.
The layer is complete at three hundred and sixty two blocks across the
resource, task, schedule, conflict and scheduler crates, including the
swept search and the improvement pass.
Seventy-five comment blocks across the error kinds, the resource model
and the window algebra. The English is unchanged and the Chinese follows
under a blank doc line, as the glossary sets out.
The search binary searches the sample list to interpolate between the two
samples that straddle a crossing, and a binary search over an unordered
list returns a wrong index instead of failing. Only the first and last
times were checked, so a sequence whose ends were in order but whose
middle was not refined each crossing against the wrong pair of positions
and reported a pass that never happened. On a circular ground track,
shuffling two samples changed the result from three passes to two and
still returned Ok.
The whole sequence is now checked, with a new UnorderedSamples error kind
that says which pair is out of order. The test covers the middle-of-
sequence case that the end check missed.
Two comments also described something other than what the code does, and
two Option-returning accessors did not say what makes them None:
- GravityModel::x2o3 is the constant 2/3, used as an exponent in the
mean motion and drag corrections, not 2 * xke^2 as its comment claimed;
the sgp4 reference implementation uses the same constant the same way.
- WalkerPattern::plane_spacing and phase_offset returned None without
saying so, which is the case a caller has to handle.
Both READMEs claimed twelve expect sites where there are thirteen, because
apsis-math/src/parallel.rs added one and the count was not carried over.
The confirmation that follows the sweep called the public feasibility
test, which scans the task list once to collect the boundaries and again,
per boundary, to sum the demand of every covering placement. That is
quadratic per task and dominated the search: removing the confirmation
alone cut the crowded case by eight, which located the cost.
The index built for the sweep is now passed into that test, so both the
boundary collection and the demand sum read a task by its identifier
instead of searching for it. The public entry point keeps its signature
and builds the index for a caller that has none.
Planning three thousand two hundred mutually contending tasks falls from
6.7 seconds to 0.48, and the plans are identical: the check compares the
start time and end of every placement, before and after, across two
resources with disjoint availability windows.
The search listed every time feasibility could change and tested each in
turn, which recomputed the load profile of every resource once per
candidate. The profile does not depend on the candidate, so it is now
swept once: the intervals where a resource has no room are cut from its
availability windows, and the earliest surviving start is read off the
front. The result is confirmed with the direct test and the enumeration is
kept as the fallback, so the sweep is an accelerator and never a second
definition of what is feasible.
The demand of a placed task is read through a vector indexed by task
identifier rather than by scanning the task list or by hashing, because the
identifier is a small dense integer and an array index beats both. Two
thousand random scenarios confirm the two forms agree exactly.
On the crowded case, where every task competes for one resource and the
capacity is the binding constraint, planning three thousand two hundred
tasks falls from 6.7 to 3.7 seconds.
Thirty four crates listed apsis-core or apsis-math without referencing it,
and apsis-kepler listed apsis-time and apsis-tle as well. Each was verified
removable by compiling with it taken out. An unused dependency still costs
build time and makes the dependency graph and the layer check report
relations that do not exist. The layer check now reports 104 edges, down
from 141.