Extends the checker to the module level `//!` docs, the tests, the
examples, and the non-Rust prose comments in the workflow, the manifests
and the shell and Python scripts.
The Delaunay and planetary arguments, the precession, nutation, polar
motion and Earth rotation angles, and the TEME and terrestrial matrices.
This completes the bilingual sweep: every comment block in the workspace
now carries its Chinese counterpart.
The event queue and identifiers, the output records and trace, the scenario
build and parse, and the run facade, including the plain comments inside
the functions.
The error modules across the remaining crates share a shape, so one table
covers them all. Also the inter-satellite link geometry and the mesh
connectivity analysis, including the Menger and Kosaraju notes.
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.
Applies the glossary across apsis-math, apsis-time, apsis-leap,
apsis-coord, apsis-geodesy and the five orbit crates that were already
implemented, plus apsis-ephemeris, apsis-maneuver and apsis-orbit. Five
hundred and seven comment blocks now carry the English paragraph and the
Chinese one.
The checker learned to skip a comment that is only a formula, since a bare
symbol has no prose to translate and repeating it in Chinese would be noise.
The SGP4 cross-check still passes, so nothing in the numerical path moved.
Four of the five physics crates are done, 104 of 239 blocks in the layer.
The remaining one is apsis-frames, which holds the IAU 2000 Earth
orientation models and carries the largest number of formulas.
All 180 comment blocks across apsis-core, apsis-units and apsis-math now
carry both languages. The checker confirms no mangled bytes and no English
word left inside a Chinese sentence, two mistakes that occurred while
writing them and are now caught mechanically.
apsis-units and apsis-core are done, 86 of 180 comment blocks in the
layer. The checker in scripts/check-bilingual.py reports which blocks still
lack Chinese, and also catches the two mistakes that are easy to make while
adding a language: a mangled byte sequence, and an English word left inside
a Chinese sentence, which is what happened once in quantity.rs and is now
caught mechanically.
Translations keep terms that have a standard Chinese name in Chinese and
leave proper nouns, abbreviations and method names in English, as the
glossary sets out. The English text is never reworded.
The comment said the inclination was rounded to one decimal place, but
the format prints it at full precision, so 53.25 degrees came out intact
where the comment promised 53.2. The notation is an identifier, so
truncating it would lose information for nothing.
The first crate of the sweep, so the layout can be checked before the
remaining forty. English paragraph, empty doc line, then the Chinese, per
the glossary. Terms with a standard Chinese name use it directly, so
semi-major axis reads 半长轴 rather than carrying the English each time;
Walker, SGP4 and the frame abbreviations stay as they are.
Every comment block in the crate now has both languages, the Display
strings are untouched because translating them would change what a program
prints, and the three formulas the comments state were checked against the
code: the phase offset is 2 pi f / t, the plane spacing 2 pi / p, and the
anomaly spacing 2 pi / (t / p), all of which match.
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.
The choice of which loops to thread follows the cost of one item and the
size of the batch, and the note records both ends: the propagation that
gains five fold over a month and barely gains over a day, and the
visibility sweep that is slower in parallel below a few hundred satellites
because a single test costs a few nanoseconds. The interfaces say the same
thing, so a caller knows when to reach for them.
The parallelism note linked to a type the module does not import, which
rustdoc rejects, so it reads as plain text now. The access batch test
computed a propagated state it did not use; it now takes the shell radius
from it so the track sits at a realistic altitude.
A single visibility test costs a few nanoseconds, so the thread start up is
only repaid by a large matrix. Measured on sixteen cores the parallel form
gains from a few hundred satellites and loses below that, so the note says
so and points a small shell at the sequential form.
Building a topology asks the same geometry question for every pair of
satellites, which is a quadratic number of independent tests, and that loop
is the dominant cost of the construction. The parallel form returns the
same row major matrix in the same order as the sequential one.
A ground station's access schedule is one search per satellite, each
independent of the others, and a shell gives enough of them to pay for the
threads. The parallel form returns the same summaries in the same order as
the sequential one, including an error at the position the sequential form
would put it, so one bad track does not hide the rest.