Document the new DPF surfaces in one command set, and test the field, half-tree, and multipoint edges.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ryan Henry 2026-09-24 23:18:10 -06:00
parent 0d8a5a8131
commit 0dff6df8ed
250 changed files with 12199 additions and 1981 deletions

View file

@ -410,7 +410,10 @@ auto eval_out_inner_product_impl(const KeyT & dpf, LaneT from, LaneT to,
const bool wraps = utils::interval_wraps(from_i, to_i, N);
const auto segs = utils::split_leaf_nodes(from_node, to_node, to_level, wraps);
HEDLEY_PRAGMA(GCC diagnostic push)
HEDLEY_PRAGMA(GCC diagnostic ignored "-Wignored-attributes")
ml_ip_accum<output_type, exterior_node> acc{};
HEDLEY_PRAGMA(GCC diagnostic pop)
std::size_t start = 0;
for (std::size_t s = 0; s < segs.n; ++s)
{
@ -552,7 +555,10 @@ void eval_out_sequence_breadth_first_impl(const KeyT & dpf,
if (begin == end)
return;
HEDLEY_PRAGMA(GCC diagnostic push)
HEDLEY_PRAGMA(GCC diagnostic ignored "-Wignored-attributes")
using allocator = aligned_allocator<node_type>;
HEDLEY_PRAGMA(GCC diagnostic pop)
allocator alloc{};
const std::size_t nseq = static_cast<std::size_t>(std::distance(begin, end));
auto memo = alloc.allocate_unique_ptr(nseq * 2);
@ -570,6 +576,8 @@ void eval_out_sequence_breadth_first_impl(const KeyT & dpf,
const node_type cw[2] = {
dpf.correction_word(level_index - 1, 0),
dpf.correction_word(level_index - 1, 1)};
const bool is_last = key_type::tree::is_last_level(level_index - 1,
key_type::depth);
const std::size_t cur = static_cast<std::size_t>(curhalf) * nseq;
const std::size_t prv = static_cast<std::size_t>(!curhalf) * nseq;
for (auto upper = std::begin(splits), lower = upper++;
@ -580,17 +588,17 @@ void eval_out_sequence_breadth_first_impl(const KeyT & dpf,
if (it == *lower)
{
memo[cur + i++] = key_type::traverse_interior(
memo[prv + j++], cw[1], 1);
memo[prv + j++], cw[1], 1, is_last);
}
else if (it == *upper)
{
memo[cur + i++] = key_type::traverse_interior(
memo[prv + j++], cw[0], 0);
memo[prv + j++], cw[0], 0, is_last);
}
else
{
auto kids = key_type::traverse_interior01(memo[prv + j++],
cw[0], cw[1]);
cw[0], cw[1], is_last);
memo[cur + i++] = kids[0];
memo[cur + i++] = kids[1];
splits.insert(upper, it);
@ -649,7 +657,17 @@ auto eval_sequence_breadth_first(out_t<I, N>, const KeyT & key,
return buf;
}
/// Build a sequence recipe stopped at slot `I`'s tree level (prefix domain).
/// @brief Build a sequence recipe stopped at slot `I`'s tree level (prefix domain).
/// @tparam I output index
/// @tparam N width in bits
/// @tparam KeyT key type
/// @tparam ForwardIterator forward iterator type
/// @tparam KeyT key type
/// @param N the `N`
/// @param key the `key`
/// @param begin the iterator to the first query
/// @param end the iterator past the last query
/// @return the constructed object
template <std::size_t I, std::size_t N, typename KeyT, typename ForwardIterator,
std::enable_if_t<is_multilevel_key_v<KeyT>, bool> = true>
auto make_sequence_recipe(out_t<I, N>, const KeyT & key, ForwardIterator begin,