Checkpoint the party/runtime stack before share-program and malicious-mode work.

Ship the TLS mesh, composer, Beaver/Yao/leaf MPC, prep/online paths, apps, and docs so the tree is pushable before elevating share_expr, security_mode, and prep resume.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ryan Henry 2026-09-28 05:59:19 -06:00
parent 695f8e84f7
commit 0d22946a0e
1835 changed files with 170291 additions and 2849 deletions

View file

@ -73,6 +73,9 @@ struct constant_lut
return values.size() - 1;
return values.size();
}
/// \complexity `upper_bound` on `bounds`. `Θ(log P)` comparisons, `P = linear_parts()`. Extra space `Θ(1)`.
/// @param x raw domain point
/// @return the piece value
HEDLEY_NO_THROW
std::int64_t operator()(Raw x) const noexcept
@ -161,7 +164,7 @@ inline bool magnitude_ge_pow10(u128 mag, int k, unsigned fractional_bits) noexce
}
/// @brief Smallest positive magnitude whose base-10 log is at least `k`.
/// @param k the `k`
/// @param k index or exponent
/// @param fractional_bits the number of fractional bits
/// @return Smallest positive magnitude whose base-10 log is at least `k`
HEDLEY_NO_THROW
@ -522,6 +525,8 @@ struct exact_lut<exact_constant::clrsb>
[=](Raw raw) { return eval<Raw>(raw, fractional_bits); });
}
};
/// \complexity One call to `exact_lut<Which>::eval`. Sign maps are a branch. Bit maps scan at most the raw width. `Θ(w)` bit operations, extra space `Θ(1)`.
/// @see grotto::make_exact_constant_lut
template <exact_constant Which, typename Raw>
std::int64_t evaluate_exact(Raw raw, unsigned fractional_bits)
@ -531,6 +536,15 @@ std::int64_t evaluate_exact(Raw raw, unsigned fractional_bits)
throw std::invalid_argument("fractional bits exceed the raw width");
return exact_lut<Which>::template eval<Raw>(raw, fractional_bits);
}
/// \complexity Dispatches to `exact_lut<Which>::project`. Sign patterns emit a constant number of cuts.
/// `ilogb`, `ceil_ilogb`, `clz`, and `clrsb` push one cut per bit of the raw width (`Θ(w)`). `ilog10` walks powers of ten.
/// Extra space is the cut and value vectors.
/// @see grotto::evaluate_exact
/// @see grotto::dyadic_lut
/// @param which which degree-0 map
/// @param fractional_bits must not exceed the raw width
/// @return the piecewise-constant table
/// @note Following Storrier, Vadapalli, Lyons, and Henry, ePrint 2023/108, Appendix D: the degree-0 exact gadgets.
template <typename Raw>
constant_lut<Raw> make_exact_constant_lut(exact_constant which, unsigned fractional_bits)
@ -577,6 +591,8 @@ enum class threshold_cmp
gt,
geq
};
/// \complexity One comparison. `Θ(1)`.
/// @see grotto::make_threshold_lut
template <typename Raw>
HEDLEY_NO_THROW
@ -591,6 +607,8 @@ std::int64_t evaluate_threshold(Raw raw, Raw bound, threshold_cmp kind) noexcept
}
return 0;
}
/// \complexity Two or three cuts (the bound, and `bound + 1` for `leq` / `gt`). `Θ(1)`.
/// @see grotto::evaluate_threshold
template <typename Raw>
constant_lut<Raw> make_threshold_lut(Raw bound, threshold_cmp kind)
@ -610,6 +628,8 @@ constant_lut<Raw> make_threshold_lut(Raw bound, threshold_cmp kind)
/// @param high the upper endpoint
/// @return `1` on the inclusive clip window `[low, high]`, `0` outside it
/// @throws std::invalid_argument if `low > high`
/// \complexity Two or three cuts. `Θ(1)`.
/// @see grotto::make_threshold_lut
template <typename Raw>
constant_lut<Raw> make_interval_lut(Raw low, Raw high)
{
@ -637,6 +657,8 @@ constant_lut<Raw> make_interval_lut(Raw low, Raw high)
/// @param high the upper endpoint
/// @return `floor(min(max(raw, low), high) / modulus)`, division toward -infinity
/// @throws std::invalid_argument if `modulus must be positive`
/// \complexity One clamp and one division. `Θ(1)`. Division is toward -infinity, as the comment on the declaration says.
/// @see grotto::make_clipped_quotient_lut
template <typename Raw>
std::int64_t evaluate_clipped_quotient(Raw raw, Raw modulus, Raw low, Raw high)
{
@ -652,6 +674,9 @@ std::int64_t evaluate_clipped_quotient(Raw raw, Raw modulus, Raw low, Raw high)
const __int128 neg = -n;
return static_cast<std::int64_t>(-((neg + d - 1) / d));
}
/// \complexity The cut loop steps by `modulus` from `low` through `high`. The header rejects spans with more than `2^16` pieces.
/// Time and extra space `Θ((high - low) / modulus)` in raw units.
/// @see grotto::evaluate_clipped_quotient
template <typename Raw>
constant_lut<Raw> make_clipped_quotient_lut(Raw modulus, Raw low, Raw high)