> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Bundles and exact rating

> How a rater travels from RSL source to your machine, how Relativities verifies it, and why each premium is exact.

A rater starts as RSL source. RSLC checks the source and compiles it into a bundle. Relativities
verifies the bundle and rates with it in Rust, on your machine.

```mermaid theme={null}
flowchart LR
  rsl["RSL source and tables"] --> rslc["RSLC check and export"]
  rslc --> bundle["Bundle"]
  bundle --> catalog["Effective catalog"]
  catalog --> load["Rater.load: verify files and ID"]
  bundle --> load
  load --> rust["rslc.PreparedRater in Rust"]
```

## A bundle\_id pins a result

Each bundle has a `bundle_id`, a hash of every file in the bundle. `Rater.load` copies the bundle
into a private directory, hashes each file, and compares the hashes with the manifest before it
rates. Pass a `bundle_id` as `revision` to rate with exactly that bundle again, offline from the
local cache.

Pin the book and analysis assumptions alongside the bundle. For a program constructed in Python, also retain the version of its `prepare` function.
A packaged program's identity covers those Python files; an engine-only bundle's identity covers its rating implementation.

A bundle in an older RSL version stops at load with a `BundleError`. The error asks for a release
in the current version.

## The RSL rates, in Rust

A bundle holds its RSL source and a generated `rater.py`. Relativities checks `rater.py` as part
of the bundle's identity, and rates with the RSL in `rslc.PreparedRater`. The same RSL then gives
the same premium on each machine.

A bundle may also carry a program layer: its `prepare`, its schema, an optional `read` and
examples. It is the
one Python a bundle brings. `Program.load` imports it after the whole bundle verifies, from the
rater's private copy, as a package of its own. A program's `bundle_id` covers the engine and each
program file, so it pins `prepare` and the rater together.
[Package a program](/relativities/how-to/package-a-program) shows the steps.

## Verification has a defined scope

Hash verification establishes bundle identity and integrity. Compiler checks establish properties of the supplied algorithm, tables, and declarations.
Source review and independent examples establish evidence that the implementation reproduces the intended filing.
[Validate a program](/relativities/how-to/validate-a-program) distinguishes these checks and the evidence to retain for a competitive study.

## Each premium is exact

The Rust runtime calculates in exact decimal arithmetic. A result row keeps each number as a
`Decimal`. A value with an infinite decimal expansion, such as one third, travels as
`{"$rational": "1/3"}`. `explain` shows these values exactly.

The DataFrame that `rate` returns is the analysis view. It holds numbers as float64, which suits
pandas. For an exact value, read `results.rows` from `rater.rate`.

## Rating stays local

Relativities rates on your machine. Submissions, books and results stay there. An API key gives
access to catalog downloads, and the catalog sees only which bundle you download.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.