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
/*
* Copyright (c) 2025-2026 Anton Kundenko <singaraiona@gmail.com>
* All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* Encoded comparison and membership over a validated vector view
* (ray_enccol_vview), never expanding the vector. The semantics are the
* predicate comparator's: values are logical_T in native order (signed for
* I16, I32, I64 and the temporal types, unsigned for BOOL, U8 and SYM ids);
* floats compare numerically with -0.0 == +0.0, a NaN being the null.
* SYM ids decide == / != / in only: an ordered operator on SYM declines,
* never ordering ids (#738). Every buffer is the caller's or on the stack. */
/* Comparison operators: OP_EQ .. OP_GE of src/ops/ops.h. */
/* `c` and the members of `set` are integer constants in the column's
* logical domain (a SYM constant is an id of the column's domain). A
* caller holding a float literal against an integer column never
* truncates it into c (generation 0 compares those in double): it
* declines and decodes. A null constant is the caller's to fold too.
* An operator outside OP_EQ .. OP_GE declines (false / -1). */
/* (x op c) over a viewed vector into bits[0..n), integer kinds (every
* encoding P1 writes for integer, temporal, BOOL, U8 and SYM), with null
* masking: rows whose bitmap bit is set get `null_result`. False when
* the view has no evaluator (RAW, DELTA_BP, a float type: see
* ray_enc_eval_cmp_f64): decode. */
bool ;
/* (x op c) of each run of an RLE view without bitmap nulls into
* pass[0..n_runs): the run-level answer ray_enc_eval_cmp expands into
* bits, for a consumer that takes runs (a selection emitted from the
* runs). False for any other view, a bitmap, or an operator
* ray_enc_eval_cmp declines. */
bool ;
/* (x in set): set holds nset logical values, sorted ascending, distinct. */
bool ;
/* Apply the null mask: bits[i] = null_result where the bitmap bit is set. */
void ;
/* Whole-vector answer of a CONST view: 1 / 0 when every row has the same
* result (the value's result equals null_result, or no nulls), else -1. */
int ;
/* The same for a float CONST view (F32 / F64 cbits) under the predicate
* comparator (-0.0 == +0.0); -1 for any other view and for a NaN c
* (generation 0 reads a NaN literal as the null constant). */
int ;
/* (x op c) over a float view (F32 widened) under the predicate comparator
* (-0.0 == +0.0), null rows set to null_result. CONST: one test; RLE:
* one test per run; DICT: the code interval [lo, hi) of the entries equal
* to c, by lower / upper bound searches on the widened entries. False for
* any other view (RAW, ALP and ALP_RD have none: decode), a non-float
* view, an operator outside OP_EQ .. OP_GE and a NaN c (the null
* constant, as ray_enc_const_decision_f64). */
bool ;
/* (x op c) of each run of a float RLE view without bitmap nulls into
* pass[0..n_runs), under ray_enc_eval_cmp_f64's comparator: the run-level
* answer it expands into bits. False for any other view, a bitmap, an
* operator it declines and a NaN c. */
bool ;
/* Exact 128-bit sum of the non-null logical values of a fully selected
* integer vector, and its non-null count. False when the encoding has no
* sum rule (DICT, nullable RLE; RAW and DELTA_BP have no view): decode.
* Integer types summed as ray_encw_type_summable lists them (BOOL, U8,
* I16, I32, I64, TIME): floats, DATE, TIMESTAMP and SYM decline, and so
* does a BOOL / U8 view holding nulls (their kernels count every row). */
bool ;
/* Rows of a viewed vector without bitmap nulls (SYM: ids, EQ / NE only)
* that compare true against c: CONST n or 0, RLE the lengths of the
* passing runs, FOR_BP a count over the packed residuals (fix 6), DICT a
* count of codes in the interval. False when the view carries a bitmap
* with nulls or has no rule (a float view, an operator outside OP_EQ ..
* OP_GE): read the vector and count it as today. c is in the column's
* logical domain, as for ray_enc_eval_cmp. */
bool ;
/* The runs of a CONST / RLE view as (logical value, first row, end row)
* triples through fn, in row order; false for any other view. A SYM
* value is its id, a BOOL / U8 one unsigned, the others signed: the value
* the vector's decode holds at those rows (a bitmap null row reads as the
* run's stored value: a caller that must see nulls declines a view with
* a nullmap). */
typedef void ;
bool ;
/* The [min, max] of the run values of a CONST / RLE view (nulls not
* excluded: a caller declines a view with a bitmap). */
void ;
/* RAY_ENCEVAL_H */