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,16 @@ struct interval_memoizer_base
HEDLEY_NO_THROW
virtual return_type end() const noexcept = 0;
/// @brief Drop a cached interval so the next `assign_interval` rebuilds
/// from the root (needed when folding a proof over the tree).
void clear_assignment()
{
dpf_ = std::nullopt;
from_ = std::nullopt;
to_ = std::nullopt;
level_index = 0;
}
virtual std::size_t assign_interval(const dpf_type & dpf, integral_type new_from, integral_type new_to)
{
static constexpr auto complement_of = std::bit_not{};
@ -148,11 +158,11 @@ struct interval_memoizer_base
std::size_t level_index; // indicates current level being built
explicit interval_memoizer_base(std::size_t output_len)
: dpf_{std::nullopt},
: output_length{output_len},
level_index{0},
dpf_{std::nullopt},
from_{std::nullopt},
to_{std::nullopt},
output_length{output_len},
level_index{0}
to_{std::nullopt}
{ }
private:
@ -167,6 +177,7 @@ struct interval_memoizer_base
/// `eval_interval(key, from, to)` allocates when you omit the memoizer.
/// @tparam DpfKey DPF key type
/// @tparam interior_node interior node
/// \complexity O(L) nodes. The buffer length is about `interval_memoizer_slots(output_len)` (the last level plus the previous level's pivot). L is that output length.
template <typename DpfKey,
typename Allocator = aligned_allocator<
typename interval_memoizer_key_t<DpfKey>::interior_node>>
@ -248,6 +259,7 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
/// @brief Every level of the interval. `retains_all_levels` is true.
/// @tparam DpfKey DPF key type
/// @tparam interior_node interior node
/// \complexity Allocates `level_endpoints[depth] + output_len` nodes: the prefix sum of `get_nodes_at_level` over every level, plus the output length.
template <typename DpfKey,
typename Allocator = aligned_allocator<
typename interval_memoizer_key_t<DpfKey>::interior_node>>
@ -326,7 +338,7 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
std::array<std::size_t, depth+1> level_endpoints{0};
for (std::size_t level=depth; level > 0; --level)
{
len = std::min(len+2 >> 1, integral_type(1) << level-1);
len = std::min((len + 2) >> 1, integral_type(1) << (level - 1));
level_endpoints[level] = len;
}
@ -468,10 +480,22 @@ HEDLEY_PRAGMA(GCC diagnostic ignored "-Wignored-attributes")
HEDLEY_PRAGMA(GCC diagnostic pop)
}
/// @brief Size for the tree walk of `[from, to]` after `offset_x`.
/// @details Leaf packing depends on alignment (and wrap). Sizing on the
/// logical endpoints alone can undersize once a wildcard `δ` is set.
/// When the offset is not ready yet, falls back to logical endpoints
/// (identity tree coordinates).
template <typename DpfKey,
typename InputT>
inline auto make_basic_interval_memoizer(const DpfKey &, InputT from, InputT to)
inline auto make_basic_interval_memoizer(const DpfKey & dpf, InputT from, InputT to)
{
using input_type = typename DpfKey::input_type;
if (dpf.offset_x.is_ready())
{
return make_basic_interval_memoizer<DpfKey>(
dpf.offset_x(static_cast<input_type>(from)),
dpf.offset_x(static_cast<input_type>(to)));
}
return make_basic_interval_memoizer<DpfKey>(from, to);
}
@ -513,8 +537,15 @@ HEDLEY_PRAGMA(GCC diagnostic pop)
template <typename DpfKey,
typename InputT>
inline auto make_full_tree_interval_memoizer(const DpfKey &, InputT from, InputT to)
inline auto make_full_tree_interval_memoizer(const DpfKey & dpf, InputT from, InputT to)
{
using input_type = typename DpfKey::input_type;
if (dpf.offset_x.is_ready())
{
return make_full_tree_interval_memoizer<DpfKey>(
dpf.offset_x(static_cast<input_type>(from)),
dpf.offset_x(static_cast<input_type>(to)));
}
return make_full_tree_interval_memoizer<DpfKey>(from, to);
}
@ -583,8 +614,15 @@ inline auto make_basic_interval_memoizer(InputT from, InputT to)
template <typename DpfKey, std::size_t I,
typename InputT,
std::enable_if_t<DpfKey::is_multilevel, bool> = true>
inline auto make_basic_interval_memoizer(const DpfKey &, InputT from, InputT to)
inline auto make_basic_interval_memoizer(const DpfKey & dpf, InputT from, InputT to)
{
using input_type = typename DpfKey::input_type;
if (dpf.offset_x.is_ready())
{
return make_basic_interval_memoizer<DpfKey, I>(
dpf.offset_x(static_cast<input_type>(from)),
dpf.offset_x(static_cast<input_type>(to)));
}
return make_basic_interval_memoizer<DpfKey, I>(from, to);
}