Archive
How each part of skoro came to be: the mathematics worked out for it, the implementation it was given, and the plan it was built by, kept as they were approved.
An entry is opened for each piece of development and moves through its stages: for a feature, the mathematics, then the implementation, the plan, the build, and last the pages that say what the feature made true. What each stage approved is kept here as it was approved. When the library later changes, a new entry revises the old one rather than rewriting it.
Click a node for a preview · drag to rearrange · Ctrl/⌘ + scroll to zoom
Done
- Least squares, motivated from MAP estimation and trust regionsDone This entry reordered the mathematics' part on least squares and Gaussian approximations so that it begins with the estimate sought and ends with the linear algebra that computes it. Five notes are new: maximum a posteriori estimation, Newton's method and trust regions, models of normals as least squares, the normal equations, and a table that pairs the optimizer's names with the estimator's, optimization and estimation, term by term, which closes the part. Two more were split off the improper Gaussian factor: what elimination leaves and the Kalman filter. The linearization gained its reading as a model in a trust region, the improper Gaussian factor its reading of the linearization as a Gaussian on the increment, and elimination in square-root form moved from first to seventh, opened by the normal equations it solves without forming. Every equation, statement and section the archive cites stayed in its note, so no done entry was amended. Every other page listed, with the landing page and the math notes, was rewritten to one sentence to a line, as the authoring guide now asks; their text did not change.
- Smooth maps before retractionsDone The Mathematics section used to define a retraction by its derivative at the origin before it said what a derivative on a manifold is. This entry reordered that foundation. The first note, now Smooth manifolds, smooth maps, and retractions, recalls smooth manifolds, smooth maps, tangent vectors and the tangent bundle from Lee. It then fixes a basis of each tangent space by a convention that asks no regularity and may be defined only on an open subset. That turns every differential into a matrix, and only after it does the note define a retraction, on the tangent bundle. The inverse function theorem makes the retraction's local inverses charts, and the chain rule shows that derivatives read through it are those the bases define. The note ends with an index of every abuse of notation the later notes make when they treat tangent vectors as columns, so that no later note speaks of coordinate-free objects. The third note keeps the gradient, the chart Hessian and the passes as Gradients and Hessians in tangent charts. The results that compare coordinates at nearby points now say that they assume is smooth.
- The uniform distribution on compact types, and broad scales of a normal on a curved typeDone A broad normal on a rotation is not a weak prior. Under the Cayley chart a tangent of length is a turn by , and once the standard deviation of the normal passes one radian its mean stops being a mode and its mass goes to the half-turns from the mean, where the chart is cut: the median angle between a draw and the mean is 1.31 rad at , 2.88 rad at and 3.12 rad at . This entry brought the uniform distribution, which is how "unknown" is said. A type of finite mass now declares its log-mass and a uniform draw in the core, beside its volume, and a categorical space has its mass without declaring it; the rotations declare and Shoemake's draw, and the test spheres and Archimedes'. A new crate, skoro-uniform, scores a quantity of such a space with the constant , draws it exactly on the host, and binds a residual of no components, so that a linearization reads it as a factor with no rows and needed no change. The normal was left as it was, exact at every scale: what a large scale does on a curved type is documented, with the table of median angles drawn from its own sampler, under the Cayley chart that the quaternions' signs put in place of the stereographic one the core's evaluation measured.
- The Mathematics section, read start to finishDone The Mathematics section was a collection of notes, one idea to a note, linked by what each builds on, while most of the mathematics the pages relied on sat in the archive's frozen documents, argued in skoro's terms. This entry made the section the mathematical analogue of Concepts (bottom-up): it holds every piece of mathematics the site relies on that is true independently of skoro, in nineteen notes that stand in an explicit order, in three parts, each note resting only on the notes before it. The writeup argues the position.
- Observed quaternions of arbitrary sign on outside dataDone The rotations, the rigid motions and the extended poses were declared as the unit quaternions and their products, with the stereographic chart, which tells from : an observed quaternion had to be given the sign of its prediction by its caller, and one given with the other sign was read as nearly a full turn away, and could wind a turn into a pose graph's estimate without notice. This entry makes them the groups themselves, , and , still stored as quaternions but up to their sign, under the Cayley chart, global on each group and blind to the sign, so that the normal on them is the law of the rotation and a measurement is observed in whatever sign it comes. The core learned to declare a type stored up to a finite group of signed permutations of its storage, and to check it, with none of its derivatives changed; every map of the rotations became a map of the group, the logarithm, its axis and angle and the interpolations those of the shorter turn; and the linearizer refuses a point at which a factor is not finite, which is how a value a half-turn from its mean, the Cayley chart's cut, is reported. The mathematics first worked out a sign-free mixture of two normals on the quaternions, and turned to the chart instead when the mixture would have needed a second law and a correction on every term. A reader of g2o's pose graphs, an example estimating one in arbitrary signs, and tests on a loop whose closure starts on the far side of its prediction show it on outside data.
- Free the constants a retirement leaves with no consumerDone A retirement removed the retired quantities and every node computed from them, but never a constant, or a value folded from constants, since those are computed from no quantity: the scales, the anchors, and each replacement's matrix and right-hand side stayed in the model after the factor that used them was gone, and the sliding_window example's model grew from 854 nodes after tick 9 to 4,121 after tick 79. This entry has a retirement also free every node it leaves needed by nothing, one that is no quantity, has no consumer, and is held by no term, binding, sampler, proposal or pin, by reference counting from what the change touched. The mathematics shows that this removes nothing a term, sampler or proposal reads and changes no value of the model, and that a model's size is then bounded by what its current quantities, terms and pins need. It decided that a handle the user holds does not keep its node, and added scope::pin and scope::unpin for the nodes that must be kept, such as a constant made once for a whole run. The sliding window now holds at most 680 nodes, and checks that the count stopped growing.
- Examples that runDone This entry gave skoro two examples that run, in the umbrella crate, each a cargo run --example target that CI runs and that fails when a check of its mathematics fails. pose_graph draws a hundred datasets from a model of poses on SE(3) and the landmarks they sight, estimates them together by Levenberg–Marquardt, and checks that the Laplace marginals at the mode contain the truth as often as they claim to, with a tolerance fixed by the statistics and the approximation's expected error before the example runs. sliding_window keeps the same model to a window of five poses over an open path, retiring the oldest at every tick into a factor linearized at the window's mode, and reports its calibration and its gap to the batch, which the mathematics does not bound.
- Linearization and eliminationDone This entry brought back the two pieces every least-squares method rests on, as two crates. skoro-elimination is the note on elimination in square-root form as code: factored problems over blocks of variables, scheduled once by COLAMD and a junction tree, eliminated clique by clique by faer's unpivoted QR on the host in double precision, and answering minimizers, integrals, draws, marginals and the factor a replacement leaves. skoro-linearize linearizes a density query at a batch of points into such problems, one per row: by each term's whitened residual, with the curved types' log-volumes folded into the right-hand sides and the others in a linear term read off the log-volumes themselves, or, for a free scale, by the normal's information root and a scale residual that carries its score. It refuses by structure what it cannot linearize, seeds one tangent pass by a colouring of the factor structure, and gives Gauss–Newton and Levenberg–Marquardt steps, marginals that name their curved quantities, and the Laplace approximation's evidence and draws in the chart. A retirement's replacement is now computed rather than written: the linearized integral of the retired terms, built as the normal's improper factor, which is the Kalman filter on linear-Gaussian terms and an iterated extended Kalman filter's step at their mode. The core gained the accessors an algorithm in another crate needs, and the normal binds its tangent under a role of its own. The methods themselves, an optimizer's loop, a damping schedule and a filter, are left to later entries.
- Improper Gaussian replacementsDone A retirement whose terms do not determine its whole blanket, as for a landmark seen by bearing from one retired pose, now has a replacement that keeps exactly what those terms said: the improper Gaussian factor in the blanket's stacked tangent at constant anchors, of any number of rows, none included, which no normalization need make a density. Stacked::improper builds it in skoro-normal, with its numbers shared or given row by row of a batch, as a retirement's Replacement or a likelihood factor. Where its rows have full rank it is the normal's Stacked replacement, and factors over a quantity accumulate as terms, which the model reads as their sum, until they determine it. It binds its residual, and its linear part under the log-volume role, whose description now says what every least-squares reader takes from it: the varying part of a term's remainder, not the volume of a chart. A factor of no rows has a residual of no components, which the core could not carry: burn's expand refuses a dimension of zero and its reshape reads one as the source's size, so the tensor layer gained a broadcast and a reshape that give the tensor of no entries there, and every pass of the core now runs on values of no entries, on the host and on wgpu. The sum of factors, and a reduction of their rows, were left to a later entry.
- Accuracy on the GPUDone Three checks of single against double precision passed on the CPU and failed on a wgpu adapter, where CI cannot run them: two of the pose's left Jacobian in the rotations' tests, and one of the exponential test sphere's log-volume in the core's. The cause was the GPU's sine and cosine, which are accurate only to an absolute error of about . Near the identity, a closed form whose numerator cancels to a power of the angle divides that error by the power, and its derivatives by higher ones. The mathematics measures the adapter's elementary functions, derives how the error reaches each closed form and its derivatives, and designs the cutoffs for a stated error of , which the tests check the adapter against before they run. The rotations' cutoff moved from to , with series long enough for double precision there. The test sphere's exponential and log-volume moved to . Every test passes on the adapter, with no tolerance changed.
- Rotations and rigid motionsDone skoro's first curved types of its own: the rotations , the rigid motions and the extended poses , a pose with a velocity, held as the unit quaternions and their semidirect products with one and two copies of , double covers of the three groups. The new crate skoro-spatial declares them as embedded types on the core's public interface, each with a global chart, stereographic in the rotation and moving the translations in the point's own frame, and a volume declared against Haar measure, so that an attitude, a pose or an extended pose is scored by the normal, observed and simulated like any other quantity. Every usual map is a composite of the core's operations, with no kernel and no derivative of its own: compositions and actions, matrices and adjoints, exponentials and logarithms, the Jacobians and their inverses with their removable singularities computed by series, interpolations and the angle between rotations, and the constructions from axes and angles, pairs of directions, matrices and Euler angles in all twelve conventions. The archive branch's matrix storage, exponential charts and fused kernels are not kept: the normal's need for a global chart decided the storage and the chart. The mathematics was reopened once, after the build, to treat the Euler angles at both of their singularities, the lock and the wrap at , which it proves cannot be removed; the residual of angles on the circle and a lock threshold set by its cost came of it, and the implementation was revised to say what each map gives within rounding of a row where it is undefined, rather than promise non-finite values there. No earth frame is assumed: frames are the user's to compose.
- Sampling a quantity from a distributionDone sample("x", T, distribution) makes a quantity at an address, scores it by a distribution and returns it, in place of quantity("x", T) followed by the distribution's score, and sample_in does the same for a space given as a value. The core gained the Distribution trait for it, whose one method adds a distribution's term at a quantity, with an implementation for references so that a distribution is passed by value or borrowed; Normal implements it by its own score, which stays, so that a caller scoring by a normal it names imports nothing. A refusal by either step is recorded at the line that called sample. It returns the quantity and not the term: the term is found from the quantity, which is scored at most once, and a model that needs the term's handle writes the two statements. The sugar adds no mathematics: sample builds exactly what those two statements build.
- Bindings of the stacked tangent's replacementDone Stacked now gives a retirement its Gaussian replacement whole. Stacked::replacement returns a Replacement holding , no proposals, and the whitened residual, the mean and the scale bound under the normal's roles, which the retirement checks and binds to the factor it adds, as the core's replacement bindings allow. Stacked::factor and Stacked::replacement bind through one helper, so that a replacement binds exactly the roles the same factor added in a scope binds, and a least-squares or Fisher-scoring reader finds the residual of a retired window as it finds any other. Stacked::log_density stays, for a caller that wants the log-density alone; changing it to return a Replacement was set aside, since it would break its callers and its name would no longer say what it gives.
- Bindings on a retirement's replacementDone A retirement's replacement can now bind roles. Replacement carries the roles its factor binds, added with Replacement::bind as TermHandle::bind adds them on a term in a scope, and Retirement::replace checks each node, refusing one reached from a quantity outside the factor's with BindingOutsideTerm before anything is removed, binds them to the factor it adds in the one snapshot it publishes, and gives back that factor's handle, or none for a retirement of nothing. Binding afterwards in a scope of its own was set aside, since it would publish a replacement with no roles before the one that binds them. The normal's Stacked, which writes a retirement's Gaussian replacement, now says that its caller binds the replacement's residual, mean and scale this way; its supplying those bindings itself is the work this opens.
- Normal distributionsDone skoro's first distribution, the normal, returns as one distribution for every space whose chart is global and whose volume is known: the law of the mean moved by normal noise through its chart, so that a measurement of a rotation, a direction or a pose is held as what was measured, observed in one query and simulated in another. Its term is the Gaussian log-density of the tangent at the mean less the chart's log-volume, which makes it an exact density against the type's reference measure from the core's measures; on the real line and vectors it is the familiar normal, and on the positive orthant the log-normal. Its sampler draws exactly by the space's own retraction; its scale is given in four forms; it binds the roles a least-squares or Fisher-scoring reader needs, the root of its expected information among them, exact on the flat spaces and stated with its error on curved ones; and it refuses, with the core's own errors, a chart that is not global, where no closed form keeps density and sampler exact. A measurement on a type without a volume or a global chart is a likelihood factor over data, and the stacked tangent gives a retirement's Gaussian replacement its form. The new crate skoro-normal holds it, tested on the core's two test spheres.
- Reference measures and chart volumes of spacesDone Every continuous space of the core now has a reference measure, given through the log-volume of its retraction's chart, and the core's appendix no longer leaves curved types without one. Space::log_volume gives the log-volume as a composite beside the retraction: zero on the Euclidean types, the logarithm of the moved point's coordinates on the positive orthant (both against Lebesgue measure), and the sum of the factors' on a product. An embedded type may declare its chart's volume with Embedded::with_volume: a log-volume written as an operation on Euclidean values, against the measure its retraction normalizes (Haar measure on a group, surface measure on a sphere, whatever the storage), and a domain, global or given by a discretization, on which the chart is a diffeomorphism onto all of the type but a set of measure zero. A type that declares none has no densities: the core refuses to score, propose or integrate out a quantity of it, and a measurement of it is a likelihood factor over data. The volume is declared rather than computed from the retraction, which would need third derivatives in a term's Hessian, and testing::check_volume holds each declaration to the area formula instead. The mathematics rests on the note densities in tangent charts, brought from the normal branch, which this entry corrected and extended with the measure a retraction normalizes in its intrinsic form and the volume of a product chart. The acceptance test's sphere declares its stereographic chart's volume, and an exponential sphere is the tests' chart with a bounded domain. The normal entry's tangent normal builds on this, and its branch drops its own copy of the note once this entry is merged.
- The coreDone The core of skoro, built to the charter: three crates in which a model can be built, queried and differentiated, but no distribution exists yet. skoro-tensor is the layer over burn, whose tensors are made at an explicit precision on the Flex device or a wgpu device. skoro-core holds the spaces of quantities (the Euclidean and positive types, products, the discrete types, and the embedded types later crates declare), the primitive operations with kernels of up to second order, composites, the writer with its snapshots, branches and building scopes, addresses, terms and the probabilistic graph, explicit random keys, queries and their compiler, the passes of a program in tangent charts, generation weighed by importance, and retirement of the quantities at any collection of addresses, a namespace's among them. skoro re-exports both. Much of it was ported from the archive branch and reshaped to the charter, and REVISIT.md lists what the archive had that the core does not bring back, each to return as an entry of its own. Along the way the workflow gained the reading orders of the crates, which the end of a build reports and an entry links to.
- What skoro isDone The library's charter: what skoro is for, who it serves, and the positions on which everything else in it rests. It was written when the repository started over, from an interrogation of the design that came before (kept on the archive branch), so that each later entry has a stated purpose to build towards and to be measured against. It settled skoro's purpose and its users, and twelve positions on the shape of its core; the home page and What is skoro? were written from it.