Repository navigation
Expand file tree
/
Copy pathLeopardFF16.h
More file actions
710 lines (659 loc) · 24.4 KB
/
Copy pathLeopardFF16.h
File metadata and controls
710 lines (659 loc) · 24.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
/*
Copyright (c) 2017 Christopher A. Taylor. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Leopard-RS nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "LeopardCommon.h"
#include "Leopard2Plan.h"
#ifdef LEO_HAS_FF16
namespace leopard { namespace backend { struct Ops; }}
/*
16-bit Finite Field Math
This finite field contains 65536 elements and each element is two bytes.
This library is designed for data that is a multiple of 64 bytes in size.
Algorithms are described in LeopardCommon.h
*/
namespace leopard { namespace ff16 {
//------------------------------------------------------------------------------
// Datatypes and Constants
// Finite field element type
typedef uint16_t ffe_t;
// Number of bits per element
static const unsigned kBits = 16;
// Finite field order: Number of elements in the field
static const unsigned kOrder = 65536;
// Modulus for field operations
static const ffe_t kModulus = 65535;
// LFSR Polynomial that generates the field elements
static const unsigned kPolynomial = 0x1002D;
//------------------------------------------------------------------------------
// API
// Returns false if the self-test fails
bool Initialize();
// Internal scalar field helpers used while constructing immutable Leopard2
// direct-repair plans. Elements use Leopard's legacy Cantor coordinates.
ffe_t MultiplyElements(ffe_t a, ffe_t b);
ffe_t InverseElement(ffe_t value);
ffe_t ElementLog(ffe_t value); // value must be nonzero
ffe_t MultiplyLogElement(ffe_t value, ffe_t multiplier_log);
// Fixed-multiplier execution helpers. multiplier_log is produced by
// ElementLog(), source and destination must not overlap, and byte_count must
// contain complete GF16 symbols. Full 64-byte ALTMAP tiles use the active SIMD
// backend. A final compact tile stores q low bytes followed by q high bytes.
void MultiplyBytes(
const backend::Ops& ops,
void* destination,
const void* source,
ffe_t multiplier_log,
uint64_t byte_count);
void MultiplyBytes(
void* destination,
const void* source,
ffe_t multiplier_log,
uint64_t byte_count);
void MultiplyAddBytes(
const backend::Ops& ops,
void* destination,
const void* source,
ffe_t multiplier_log,
uint64_t byte_count);
void MultiplyAddBytes(
void* destination,
const void* source,
ffe_t multiplier_log,
uint64_t byte_count);
// Compile an exact parent-preserving flat schedule. Algorithm 5 plan setup
// uses this internally for shortened, punctured, and requested masks.
bool PreparePrunedTransformPlan(
unsigned size,
unsigned shift,
bool inverse,
const uint8_t* input_mask,
const uint8_t* output_mask,
leopard2_internal::PrunedTransformPlan& plan);
bool PrepareSparseForwardPlan(
unsigned size,
unsigned shift,
uint8_t* dependency_workspace,
size_t dependency_bytes,
uint8_t* operation_masks,
size_t retained_bytes,
leopard2_internal::SparseForwardPlanStats& stats);
bool ExecuteSparseForwardPlan(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned size,
unsigned shift,
const uint8_t* operation_masks,
size_t retained_bytes,
void** work);
bool ExecuteSparseForwardPlanFromSources(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned size,
unsigned shift,
const uint8_t* operation_masks,
size_t retained_bytes,
void* const* source,
void** work);
void ReedSolomonEncodeWithSourcePolicy(
const backend::Ops& ops,
uint64_t buffer_bytes,
uint64_t source_policy_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned requested_output_count,
unsigned m,
const void* const * const data,
void** work,
const leopard2_internal::SparseForwardPlanBatchView* sparse_plans);
void ReedSolomonEncode(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned m, // = NextPow2(recovery_count)
const void* const * const data,
void** work); // m * 2 elements
void ReedSolomonEncode(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned requested_output_count,
unsigned m,
const void* const * const data,
void** work,
const leopard2_internal::SparseForwardPlanBatchView* sparse_plans);
void ReedSolomonEncode(
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned m, // = NextPow2(recovery_count)
const void* const * const data,
void** work); // m * 2 elements
// Encodes the low-rate coordinate profile:
// [ data: 0 .. p-1 ][ recovery: p .. ]
// original_count may be smaller than p; the remaining data coordinates are
// shortened to zero. Null recovery output pointers are not written. p must
// be a power of two in [2, kOrder / 2].
void ReedSolomonEncodeLow(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned p, // = NextPow2(original_count)
const void* const * const data,
void* const * const recovery,
void** work); // p * 2 elements
void ReedSolomonEncodeLow(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned p,
const void* const * const data,
void* const * const recovery,
void** work,
const leopard2_internal::SparseForwardPlanBatchView* sparse_plans);
void ReedSolomonEncodeLow(
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned p, // = NextPow2(original_count)
const void* const * const data,
void* const * const recovery,
void** work); // p * 2 elements
// Precomputes logarithmic error-locator evaluations for an active power-of-two
// parent. erasures contains n bytes, one for each active coordinate.
void PrepareDecode(
unsigned n,
const uint8_t* erasures,
ffe_t* locator_logs); // n elements
// Variant for callers that have already validated and counted erasures.
// The count selects the direct or Walsh construction; erasures remains the
// authoritative coordinate mask used to construct the locator.
void PrepareDecodeKnownCount(
unsigned n,
const uint8_t* erasures,
unsigned erasure_count,
ffe_t* locator_logs); // n elements
// Reuses locator contributions for permanent erasures (for example punctured
// parent coordinates) and adds the pattern-specific erasures. erasures may
// include or exclude permanent_erasures; both conventions produce the union.
// The base array must have been produced by PrepareDecode for
// permanent_erasures.
void PrepareDecodeWithPermanent(
unsigned n,
const uint8_t* erasures,
const uint8_t* permanent_erasures,
const ffe_t* permanent_locator_logs,
ffe_t* locator_logs); // n elements
// As above, with an already-known count of erasures not contained in the
// permanent mask.
void PrepareDecodeWithPermanentKnownCount(
unsigned n,
const uint8_t* erasures,
const uint8_t* permanent_erasures,
const ffe_t* permanent_locator_logs,
unsigned dynamic_erasure_count,
ffe_t* locator_logs); // n elements
// Full-field FWHT implementation retained as an independent differential
// oracle for the sparse and dense active-parent locator paths.
void PrepareDecodeWalshReference(
unsigned n,
const uint8_t* erasures,
ffe_t* locator_logs); // n elements
// Active-parent Walsh convolution used by the dense production setup path.
// Its work and output storage are both proportional to n.
void PrepareDecodeWalshActive(
unsigned n,
const uint8_t* erasures,
ffe_t* locator_logs); // n elements
// Runtime-backend companion. A qualified backend may provide the same
// active-parent convolution directly; unsupported backends and small parents
// retain PrepareDecodeWalshActive exactly.
void PrepareDecodeWalshActiveWithBackend(
const backend::Ops& ops,
unsigned n,
const uint8_t* erasures,
ffe_t* locator_logs); // n elements
// Scalar active-parent direct product retained as the independent dense-path
// oracle and selected for sparse erasure sets.
void PrepareDecodeDirect(
unsigned n,
const uint8_t* erasures,
ffe_t* locator_logs); // n elements
// Returns the deterministic built-in locator setup decision for this field.
bool IsDirectLocatorPreferred(unsigned n, unsigned erasure_count);
// Generic active-parent decoder using locator evaluations from PrepareDecode.
// Null coordinate_data pointers are treated as zero. Only coordinates marked
// in requested_outputs are revealed, in-place, in the corresponding work slot.
void ReedSolomonDecodePrepared(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
const void* const * const coordinate_data, // n elements
const uint8_t* requested_outputs, // n elements
const ffe_t* locator_logs, // n elements
void** work); // n elements
void ReedSolomonDecodePrepared(
uint64_t buffer_bytes,
unsigned n,
const void* const * const coordinate_data, // n elements
const uint8_t* requested_outputs, // n elements
const ffe_t* locator_logs, // n elements
void** work); // n elements
// Allocation-free execution companion for an immutable Leopard2 decode plan.
// All pattern-dependent traversal and prefix values are prepared by the plan.
// If reveal_outputs is false, requested work rows remain locator-weighted so
// the caller can fuse inverse-locator multiplication with output scatter.
void ReedSolomonDecodePlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
const void* const * const coordinate_data, // n elements
unsigned input_count,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs, // n elements
bool reveal_outputs,
void** work); // n elements
void ReedSolomonDecodePlanned(
uint64_t buffer_bytes,
unsigned n,
const void* const * const coordinate_data, // n elements
unsigned input_count,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs, // n elements
void** work); // n elements
// Precompute the active-parent fixed factors used by the IT2026 specialized
// low/high original-recovery decoders.
void PrepareLowDecode(
unsigned n,
unsigned p,
ffe_t* block_factors); // n / p - 1 elements
void PrepareHighDecode(
unsigned n,
unsigned t,
ffe_t* output_factors); // n elements; t..n-1 are initialized
#if defined(LEO2_ENABLE_TEST_HOOKS)
// Internal test-only access to the exact production LCH kernels and constants.
// These are deliberately absent from leopard2.h and from non-test builds.
struct TestOnlyTransformCallsiteCounts
{
uint64_t ifft_dit4;
uint64_t fft_dit4;
uint64_t ifft_dit4_fused;
uint64_t ifft_dit4_split;
uint64_t fft_dit4_fused;
uint64_t fft_dit4_split;
};
struct TestOnlyLowEncodeCounts
{
uint64_t fft_butterfly2_out_of_place;
uint64_t fft_butterfly4_out_of_place;
uint64_t direct_output_blocks;
uint64_t direct_output_butterfly2_out_of_place;
uint64_t direct_output_butterfly4_out_of_place;
};
struct TestOnlyHighEncodeCounts
{
uint64_t ifft_butterfly4_out_of_place;
uint64_t input_copy_shards;
};
struct TestOnlySparseEncodeCounts
{
uint64_t exact_blocks;
uint64_t prefix_butterflies;
uint64_t retained_butterflies;
uint64_t requested_output_copies;
};
struct TestOnlyHighDecodeCounts
{
uint64_t output_blocks;
uint64_t fft_butterfly2_out_of_place;
uint64_t fft_butterfly4_out_of_place;
uint64_t compatibility_copy_fallbacks;
uint64_t pruned_output_blocks;
uint64_t mature_output_blocks;
uint64_t syndrome_accumulated_blocks;
uint64_t syndrome_materialized_blocks;
uint64_t syndrome_pruned_accumulated_blocks;
uint64_t syndrome_pruned_fallback_blocks;
uint64_t syndrome_block_zero_ifft_elisions;
uint64_t syndrome_forward_transforms;
uint64_t syndrome_forward_transform_elisions;
uint64_t syndrome_block_zero_xor_shards;
uint64_t receive_ifft_butterfly4_out_of_place;
uint64_t receive_copy_shards;
uint64_t receive_zero_shards;
};
void TestOnlyResetTransformCallsiteCounts();
TestOnlyTransformCallsiteCounts TestOnlyGetTransformCallsiteCounts();
void TestOnlyResetLowEncodeCounts();
TestOnlyLowEncodeCounts TestOnlyGetLowEncodeCounts();
void TestOnlyResetHighEncodeCounts();
TestOnlyHighEncodeCounts TestOnlyGetHighEncodeCounts();
void TestOnlyResetSparseEncodeCounts();
TestOnlySparseEncodeCounts TestOnlyGetSparseEncodeCounts();
void TestOnlyResetHighDecodeCounts();
TestOnlyHighDecodeCounts TestOnlyGetHighDecodeCounts();
// Attribution-only selector. This changes only the test-hooks archive and
// forces the retained whole-coefficient-block copy path for every Algorithm 5
// output block. Production archives do not contain the selector or branch.
void TestOnlySetHighDecodeCopyFallback(bool enabled);
bool TestOnlyHighDecodeCopyFallbackEnabled();
ffe_t TestOnlyFFTMultiplier(unsigned logical_index);
ffe_t TestOnlySubspaceDerivative(unsigned size);
ffe_t TestOnlySubspaceAt(unsigned size, unsigned shift);
ffe_t TestOnlyLchNormalizer(unsigned index);
void TestOnlyLchForward(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned size,
unsigned shift,
unsigned requested_output_count,
void** work);
void TestOnlyLchForward(
uint64_t buffer_bytes,
unsigned size,
unsigned shift,
unsigned requested_output_count,
void** work);
void TestOnlyLchInverse(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned size,
unsigned shift,
unsigned known_input_count,
void** work);
void TestOnlyLchInverse(
uint64_t buffer_bytes,
unsigned size,
unsigned shift,
unsigned known_input_count,
void** work);
void TestOnlyAddFormalDerivative(
uint64_t buffer_bytes,
unsigned size,
void** work);
#endif
void ReedSolomonDecodeLowPrepared(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint8_t* requested_outputs,
const ffe_t* locator_logs,
const ffe_t* block_factors,
void** work);
void ReedSolomonDecodeLowPrepared(
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint8_t* requested_outputs,
const ffe_t* locator_logs,
const ffe_t* block_factors,
void** work);
void ReedSolomonDecodeLowPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs,
const ffe_t* block_factors,
void** work);
// Algorithm 4 with immutable C1 schedules prepared by
// leo2_decode_plan_create. Missing schedules select the mature prefix/input
// and dependency/output fallbacks.
void ReedSolomonDecodeLowPrunedPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs,
const ffe_t* block_factors,
const leopard2_internal::PrunedTransformBlock* input_plans,
unsigned input_plan_count,
const leopard2_internal::PrunedTransformPlan* output_plan,
void** work);
// Identical Algorithm 4 execution, but leaves requested outputs in evaluator
// form so the caller can combine inverse-locator multiplication with scatter.
// This is only valid when the caller supplies a distinct full-tile destination.
void ReedSolomonDecodeLowPrunedPlannedUnrevealed(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs,
const ffe_t* block_factors,
const leopard2_internal::PrunedTransformBlock* input_plans,
unsigned input_plan_count,
const leopard2_internal::PrunedTransformPlan* output_plan,
void** work);
void ReedSolomonDecodeLowPlanned(
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs,
const ffe_t* block_factors,
void** work);
/*
Side-sized production form of Algorithm 4. work contains exactly 2*p
shard pointers: the first p hold the final requested message block and the
second p are a reusable parent-block tile.
*/
void ReedSolomonDecodeLowTiledPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs,
const ffe_t* block_factors,
void** work);
void ReedSolomonDecodeLowTiledPrunedPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs,
const ffe_t* block_factors,
const leopard2_internal::PrunedTransformBlock* input_plans,
unsigned input_plan_count,
const leopard2_internal::PrunedTransformPlan* output_plan,
void** work);
void ReedSolomonDecodeLowTiledPrunedPlannedUnrevealed(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned p,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
unsigned requested_count,
const leopard2_internal::OutputDependencyView& output_dependencies,
const ffe_t* locator_logs,
const ffe_t* block_factors,
const leopard2_internal::PrunedTransformBlock* input_plans,
unsigned input_plan_count,
const leopard2_internal::PrunedTransformPlan* output_plan,
void** work);
void ReedSolomonDecodeHighPrepared(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned t,
const void* const * const coordinate_data,
const uint8_t* requested_outputs,
const ffe_t* locator_logs,
const ffe_t* output_factors,
void** work);
void ReedSolomonDecodeHighPrepared(
uint64_t buffer_bytes,
unsigned n,
unsigned t,
const void* const * const coordinate_data,
const uint8_t* requested_outputs,
const ffe_t* locator_logs,
const ffe_t* output_factors,
void** work);
void ReedSolomonDecodeHighPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned t,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
const leopard2_internal::DecodeOutputBlock* output_blocks,
unsigned output_block_count,
const ffe_t* locator_logs,
const ffe_t* output_factors,
void** work);
// A non-null systematic_output is indexed by requested coordinate - t and
// receives the out-of-place reveal for complete public-layout passes. Null
// retains the materialized in-place reveal required by compact tails.
void ReedSolomonDecodeHighPrunedPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned t,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
const leopard2_internal::DecodeOutputBlock* output_blocks,
unsigned output_block_count,
const ffe_t* locator_logs,
const ffe_t* output_factors,
const leopard2_internal::PrunedTransformBlock* input_plans,
unsigned input_plan_count,
const leopard2_internal::PrunedTransformPlan* output_plans,
unsigned output_plan_count,
void* const* systematic_output,
void** work);
void ReedSolomonDecodeHighPlanned(
uint64_t buffer_bytes,
unsigned n,
unsigned t,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
const leopard2_internal::DecodeOutputBlock* output_blocks,
unsigned output_block_count,
const ffe_t* locator_logs,
const ffe_t* output_factors,
void** work);
/*
Side-sized production form of Algorithm 5. work contains exactly 2*t
shard pointers. requested_output contains one disjoint kernel-layout
destination for each requested coordinate, in requested_coordinates order.
*/
void ReedSolomonDecodeHighTiledPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned t,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
const leopard2_internal::DecodeOutputBlock* output_blocks,
unsigned output_block_count,
const ffe_t* locator_logs,
const ffe_t* output_factors,
void* const* requested_output,
void** work);
void ReedSolomonDecodeHighTiledPrunedPlanned(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned n,
unsigned t,
const void* const * const coordinate_data,
const uint16_t* block_input_counts,
const uint32_t* requested_coordinates,
const leopard2_internal::DecodeOutputBlock* output_blocks,
unsigned output_block_count,
const ffe_t* locator_logs,
const ffe_t* output_factors,
void* const* requested_output,
const leopard2_internal::PrunedTransformBlock* input_plans,
unsigned input_plan_count,
const leopard2_internal::PrunedTransformPlan* output_plans,
unsigned output_plan_count,
void** work);
void ReedSolomonDecode(
const backend::Ops& ops,
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned m, // = NextPow2(recovery_count)
unsigned n, // = NextPow2(m + original_count)
const void* const * const original, // original_count elements
const void* const * const recovery, // recovery_count elements
void** work); // n elements
void ReedSolomonDecode(
uint64_t buffer_bytes,
unsigned original_count,
unsigned recovery_count,
unsigned m, // = NextPow2(recovery_count)
unsigned n, // = NextPow2(m + original_count)
const void* const * const original, // original_count elements
const void* const * const recovery, // recovery_count elements
void** work); // n elements
}} // namespace leopard::ff16
#endif // LEO_HAS_FF16