Skip to main content

ExplodePolicy

Enum ExplodePolicy 

Source
pub enum ExplodePolicy {
    Off,
    Graph,
    Commits,
    Full,
}
Expand description

How much of a pack is resolved into the exploded table.

Three values and not a boolean, because a flat off-switch reintroduces a correctness bug this table exists to fix. Commit and tree payloads used to live only in RAM, so a clean shutdown came back with every pack’s indexed bit legitimately set and an EMPTY graph — MEASURED on oden 2026-08-08: 2687 rows and 0 of 551 commits, reachable() returning a commit instead of its closure and gc seeing an empty live set.

MEASURED on linux.git: resolved content is 16.8 GB against a 6.4 GB pack, and blobs are nearly all of it. So Graph buys the correctness fix for a small fraction of the disk, and Full — one-lookup content reads, thin-pack bases, and the path columns that make the table a filesystem — is the part worth charging for.

The default is Commits since lane Q (2026-08-30), and the change is a measurement. §14’s indexed bit is derived by comparing this table’s row count against the index’s, so a table that is deliberately short is indistinguishable, on disk, from one that was dropped — see [crate::git_ops::Absorber::adopt_journal], which weakens that comparison for every deliberately-short policy and cannot make it exact without a durable per-kind count. That weakening is the price of the default, it is stated here rather than hidden, and it costs a store that really did lose its table one extra fall-back read per object rather than a re-ingest.

Variants§

§

Off

Store nothing. Reads re-resolve, and every pack is re-queued on reopen — which is what rebuilds the graph, since nothing it is folded from is on disk.

§

Graph

Commits and trees, both eager. The shape lane Q shipped first and measured: on the real torvalds/linux mirror the tree payloads alone are 28.24 GB — 3.24× the 8.13 GiB pack — and folding them into RAM took peak RSS to 50.9 GiB. Kept as a setting, because a small repository that is read constantly wants exactly this; not the default, because an appliance ships with 16 GB.

§

Commits

Commits and tags only — the SHIPPED DEFAULT since lane Q (2026-08-30).

The index-only-at-push shape of ideas/lazy-explode-index-only-at-push.md, in full. Commits are what graph and reach fold and what a visibility or pull check reads; a tag is what a clone peels. Both are small and both stay eager, so neither ever stalls. Trees and blobs — 90 % of the objects and essentially all of the bytes — are written into crate::exploded_cache’s budgeted pool by the FIRST reader that inflates one, and evicted from it when the budget says so.

Trees became lazy when crate::reach::TreeSource replaced the resident HashMap<String, Vec<u8>> that crate::serve’s closure walk and the reachability builder both read. That map was the 28.24 GB above.

MEASURED, torvalds/linux, oden 2026-08-30, /data bytes per pack byte:

eager (Full)GraphCommits
at ack1.05×1.05×1.05×
at index-complete22.4× (lane P, 78 % done)4.58×see the lane Q rows
§

Full

Every object, eagerly, with no bound. What shipped before lane Q and what the 17× measurement is of; kept so a bench can measure the unbounded shape and so a store written under it still opens.

Implementations§

Source§

impl ExplodePolicy

Source

pub const fn wants(self, kind: GitObjectKind) -> bool

Source

pub const fn as_str(self) -> &'static str

Source

pub fn parse(s: &str) -> Result<Self>

An unknown value is an ERROR, never a silent fall back to the default: a typo that quietly disables a paid tier is not noticed until a bill is wrong.

Source

pub fn from_env() -> Result<Self>

Reads ZNIPPY_GIT_EXPLODE (crate::arms::ENV_EXPLODE) through the crate’s one counted door, once per store open.

Trait Implementations§

Source§

impl Clone for ExplodePolicy

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExplodePolicy

Source§

impl Debug for ExplodePolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExplodePolicy

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ExplodePolicy

Source§

impl PartialEq for ExplodePolicy

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExplodePolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more