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

@ -156,17 +156,39 @@ class parallel_const_bit_iterator
HEDLEY_ALWAYS_INLINE
value_type operator*() const noexcept
{
value_type ret;
simde_type temp = helper::bit_and(all_vecs_[element_cnt_], vec_mask_);
std::memcpy(ret.data(), &temp, bytes_per_batch);
return ret;
value_type ret{};
// One element per word (batches 1..4 with uint64 words): the in-place
// bit is just `word & mask`. Skip the SIMD rebuild + memcpy used for
// wider batches that pack several element lanes per word.
if constexpr (word_mask_path)
{
for (std::size_t i = 0; i < batch_size; ++i)
ret[i] = static_cast<element_type>(cur_word_[i] & word_mask_);
return ret;
}
else
{
simde_type temp = helper::bit_and(all_vecs_[element_cnt_], vec_mask_);
std::memcpy(ret.data(), &temp, bytes_per_batch);
return ret;
}
}
HEDLEY_NO_THROW
HEDLEY_ALWAYS_INLINE
parallel_const_bit_iterator & operator++() noexcept
{
if (HEDLEY_UNLIKELY(!(word_mask_ <<= 1)))
if constexpr (word_mask_path)
{
if (HEDLEY_UNLIKELY(!(word_mask_ <<= 1)))
{
word_mask_ = word_lsb;
std::transform(iter_.begin(), iter_.end(), cur_word_.begin(),
[](auto & it) { return *(++it); });
}
return *this;
}
else if (HEDLEY_UNLIKELY(!(word_mask_ <<= 1)))
{
word_mask_ = word_lsb;
element_mask_ = element_lsb;
@ -205,7 +227,17 @@ class parallel_const_bit_iterator
HEDLEY_ALWAYS_INLINE
parallel_const_bit_iterator & operator--() noexcept
{
if (HEDLEY_UNLIKELY(!(word_mask_ >>= 1)))
if constexpr (word_mask_path)
{
if (HEDLEY_UNLIKELY(!(word_mask_ >>= 1)))
{
word_mask_ = word_msb;
std::transform(iter_.begin(), iter_.end(), cur_word_.begin(),
[](auto & it) { return *(--it); });
}
return *this;
}
else if (HEDLEY_UNLIKELY(!(word_mask_ >>= 1)))
{
word_mask_ = word_msb;
element_mask_ = element_msb;
@ -260,6 +292,11 @@ class parallel_const_bit_iterator
static constexpr word_type word_msb = word_lsb << (bits_per_word-1);
static constexpr element_type element_lsb = element_type(1);
static constexpr element_type element_msb = element_lsb << (bits_per_element-1);
// Batches 1..4 use one uint64 element per word; the parallel lane is then
// exactly `cur_word & word_mask` (same encoding as the SIMD path).
static constexpr bool word_mask_path =
(elements_per_word == 1)
&& std::is_same_v<word_type, element_type>;
template<std::size_t ...Is>
word_array dereferencing_initializer_impl(
@ -282,8 +319,9 @@ class parallel_const_bit_iterator
element_mask_{element_lsb},
element_cnt_{0},
cur_word_{dereferencing_initializer(arr)},
vec_mask_{helper::get_mask()},
all_vecs_{helper::build_vecs(cur_word_.data(), batch_size)}
vec_mask_{word_mask_path ? simde_type{} : helper::get_mask()},
all_vecs_{word_mask_path ? simde_array{}
: helper::build_vecs(cur_word_.data(), batch_size)}
{ }
word_pointer_array iter_;