Files
leleka/crates/engine-qwen35-cuda/tests/stra161_reference.rs
T
Pavlo Ratushnyi da8c974f68 Drop the stale engine/strata paths and retired generator names from comments, doc strings and generated fixtures (STRA-407)
Rust comments that named scripts/offline/*, gen_goldens.py, oracle/gen_*.{sh,cpp,py}, build_oracle.sh and similar retired generators now say where the data
came from (the Original's code, Strata 41cf05a0) or drop the sentence. The path/generator text of seven generated fixtures (sampler_oracle.json, sampling_keys.json,
memory_plan_golden.json, rope_golden.json, cvec_oracle.json, stra161 fixtures.json, commentary-tool-prompt.json) is reworded; no test reads those fields and no pin
covers their bytes. cmd_time/doc.rs: the two path texts in the format string; its lines are re-broken so they stay within 120 columns (the string is unchanged
otherwise). Comment-only except those data/string spots; no behaviour change.
2026-11-23 22:37:17 +01:00

333 lines
15 KiB
Rust

// Independent original-source literals frozen before STRA161 candidate.
// Generated offline from the Original's source; imports no candidate.
#![allow(dead_code)]
pub struct HashCase {
pub name: &'static str,
pub token: u32,
pub prev: [i32; 2],
pub rows: [u32; 16],
}
pub const HASH_CASES: &[HashCase] = &[
HashCase {
name: "original-0-0",
token: 11,
prev: [-1, -1],
rows: [
13555483, 24877159, 54278900, 63631058, 98394898, 117447587, 136774765, 157274238, 173487882, 192109366,
213364329, 236577563, 258758149, 262164274, 283572184, 312653920,
],
},
HashCase {
name: "original-0-1",
token: 22,
prev: [11, -1],
rows: [
3278367, 29880471, 46922633, 62971672, 94904487, 113013549, 120925297, 159537733, 161636484, 186269036,
207870452, 237789268, 242975733, 269388091, 285131318, 305889870,
],
},
HashCase {
name: "original-0-2",
token: 33,
prev: [22, 11],
rows: [
2485282, 23858032, 54544880, 69506925, 82331991, 106607168, 133019998, 141570514, 173894108, 180423171,
211374553, 239810912, 253076960, 266343146, 290765399, 312876099,
],
},
HashCase {
name: "original-0-3",
token: 44,
prev: [33, 22],
rows: [
12721672, 27113445, 44309803, 60385209, 97021817, 115900810, 134219364, 151977589, 161183764, 181257609,
201344488, 221596875, 241635416, 261674107, 281687144, 301751935,
],
},
HashCase {
name: "original-1-0",
token: 7,
prev: [-1, -1],
rows: [
2927653, 34980843, 54748278, 66612378, 97814964, 109013870, 126560393, 151352333, 167888935, 182235580,
215170017, 237467519, 247510681, 278779700, 296141806, 304994522,
],
},
HashCase {
name: "original-1-1",
token: 8,
prev: [7, 248044],
rows: [
7508793, 29969020, 54939975, 74089003, 91535754, 104816064, 125484693, 154439441, 164805529, 181662903,
214193203, 238193346, 259492009, 262016223, 296463606, 310742083,
],
},
HashCase {
name: "original-1-2",
token: 9,
prev: [248044, 7],
rows: [
5471414, 32902469, 56618078, 65819961, 82278798, 107765152, 125994638, 156967341, 179716672, 187881262,
219224344, 222418510, 250276020, 278493068, 281311927, 316005603,
],
},
HashCase {
name: "original-2-0",
token: 100,
prev: [-1, -1],
rows: [
5727835, 21884476, 43702108, 66434789, 84094509, 104112171, 134886528, 157314943, 162363667, 189466439,
200618315, 232121522, 258547276, 266199001, 289022207, 305180972,
],
},
HashCase {
name: "original-2-1",
token: 101,
prev: [-1, -1],
rows: [
14526383, 36975477, 51939184, 65076202, 94510971, 111786935, 138448715, 155393638, 167579692, 181767276,
211184823, 226303266, 246271192, 267465224, 281469089, 313531602,
],
},
HashCase {
name: "original-3-0",
token: 100,
prev: [0, 0],
rows: [
223356, 29869136, 44693816, 65450370, 83243562, 109175069, 138072664, 149936704, 175869089, 193667153,
214433731, 233779437, 242682975, 271587098, 294555343, 309396483,
],
},
HashCase {
name: "original-3-1",
token: 101,
prev: [100, 0],
rows: [
9825591, 35767834, 58740777, 62904867, 86476006, 107666813, 129453358, 151836075, 160726459, 190511348,
208596315, 234569026, 259467109, 264365567, 292665383, 314164387,
],
},
HashCase {
name: "original-4-0",
token: 248044,
prev: [-1, -1],
rows: [
9663979, 26558231, 56120240, 74755659, 80459717, 109265651, 132697467, 151022725, 170054832, 192967038,
200687722, 225763581, 259275737, 272983544, 297596484, 300986548,
],
},
HashCase {
name: "original-4-1",
token: 5,
prev: [248044, -1],
rows: [
15389869, 39778609, 55713969, 62213332, 88817728, 118483999, 133731511, 155458159, 179763390, 197956758,
205378969, 220499474, 242466248, 265658744, 293662119, 315720898,
],
},
HashCase {
name: "original-4-2",
token: 248044,
prev: [5, 248044],
rows: [
9663979, 26558231, 56120240, 74755659, 80459717, 109265651, 132697467, 151022725, 170054832, 192967038,
200687722, 225763581, 259275737, 272983544, 297596484, 300986548,
],
},
HashCase {
name: "original-5-0",
token: 248043,
prev: [-1, -1],
rows: [
5224855, 30284709, 43929396, 72280505, 94883662, 109322550, 131203836, 140794991, 166459826, 181131035,
209237474, 226844350, 246236135, 265823742, 299063341, 305586418,
],
},
HashCase {
name: "original-5-1",
token: 12345,
prev: [248043, -1],
rows: [
11270970, 23825822, 53627731, 75297762, 86108900, 117131242, 124369521, 148669731, 173053968, 186938961,
219076364, 237563026, 246838602, 277288915, 294366759, 301712965,
],
},
HashCase {
name: "original-5-2",
token: 248043,
prev: [12345, 248043],
rows: [
9040325, 23423119, 51729309, 72606490, 88803423, 101106903, 139785146, 145105493, 165075797, 186774126,
216848848, 228384799, 252197080, 276291559, 284385762, 305326936,
],
},
HashCase {
name: "original-5-3",
token: 7,
prev: [248043, 12345],
rows: [
4918924, 35785322, 51404601, 69479989, 96595301, 119006811, 132661231, 157603286, 167367331, 194295259,
207336314, 231383366, 248222822, 265383752, 291175661, 300670030,
],
},
HashCase {
name: "original-5-4",
token: 200000,
prev: [7, 248043],
rows: [
19540326, 36155593, 54730668, 61035256, 83860210, 111525643, 123077188, 158579165, 171421264, 181503411,
210257194, 220050508, 255765827, 271545193, 290152687, 303296503,
],
},
HashCase {
name: "zero",
token: 0,
prev: [0, 0],
rows: [
0, 20000003, 40000026, 60000059, 80000106, 100000165, 120000228, 140000297, 160000374, 180000455,
200000548, 220000655, 240000802, 260000955, 280001114, 300001275,
],
},
HashCase {
name: "oldest-null",
token: 8,
prev: [-1, 7],
rows: [
17329723, 28464492, 44031928, 69826401, 80507399, 110734489, 136075079, 156529177, 176740572, 199715560,
201670584, 220899605, 256162416, 271784618, 290405356, 304107632,
],
},
HashCase {
name: "newest-null",
token: 8,
prev: [7, -1],
rows: [
7508793, 29969020, 54939975, 74089003, 91535754, 104816064, 125484693, 154439441, 164805529, 181662903,
214193203, 238193346, 259492009, 262016223, 296463606, 310742083,
],
},
HashCase {
name: "oldest-eos",
token: 9,
prev: [248044, 7],
rows: [
5471414, 32902469, 56618078, 65819961, 82278798, 107765152, 125994638, 156967341, 179716672, 187881262,
219224344, 222418510, 250276020, 278493068, 281311927, 316005603,
],
},
HashCase {
name: "newest-eos",
token: 9,
prev: [7, 248044],
rows: [
18043673, 37626835, 51159316, 78294604, 94015356, 106720349, 136526052, 144330141, 176817901, 186368539,
203707490, 230017629, 247662678, 266533413, 293096193, 307951937,
],
},
HashCase {
name: "tokenizer-eos-not-ple-eos",
token: 9,
prev: [7, 248046],
rows: [
15021010, 35157757, 58966972, 76489564, 92542227, 105357841, 125329426, 153354782, 165228787, 182703128,
210962064, 235778055, 243941989, 273003868, 282890671, 313820845,
],
},
HashCase {
name: "current-eos-keeps-context",
token: 248044,
prev: [11, 22],
rows: [
9649829, 25931806, 48482786, 64993297, 80874378, 113775613, 134009371, 142634030, 170087912, 191029788,
214145939, 237657013, 259240851, 261882900, 282998934, 310342410,
],
},
HashCase {
name: "max-vocabulary",
token: 248319,
prev: [248318, 248319],
rows: [
3035822, 30922970, 45995374, 64361017, 92705579, 115727959, 130487234, 157254389, 176190258, 184022063,
210818569, 238984490, 254962129, 271136118, 289904521, 304073142,
],
},
];
pub struct DecodeCase {
pub name: &'static str,
pub encoded: [u8; 90],
pub expected_words: [u32; 160],
}
pub const DECODE_CASES: &[DecodeCase] = &[
DecodeCase {
name: "split-nibbles",
encoded: [
0, 60, 240, 225, 210, 195, 180, 165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 15, 0, 188, 240, 225, 210,
195, 180, 165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 15, 0, 56, 240, 225, 210, 195, 180, 165, 150, 135,
120, 105, 90, 75, 60, 45, 30, 15, 1, 0, 240, 225, 210, 195, 180, 165, 150, 135, 120, 105, 90, 75, 60, 45,
30, 15, 0, 128, 240, 225, 210, 195, 180, 165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 15,
],
expected_words: [
3271426048, 3268411392, 3265658880, 3263299584, 3259236352, 3255566336, 3249537024, 3240099840, 1065353216,
1095761920, 1103626240, 1108869120, 1112801280, 1116340224, 1118961664, 1122107392, 1122107392, 1118961664,
1116340224, 1112801280, 1108869120, 1103626240, 1095761920, 1065353216, 3240099840, 3249537024, 3255566336,
3259236352, 3263299584, 3265658880, 3268411392, 3271426048, 1123942400, 1120927744, 1118175232, 1115815936,
1111752704, 1108082688, 1102053376, 1092616192, 3212836864, 3243245568, 3251109888, 3256352768, 3260284928,
3263823872, 3266445312, 3269591040, 3269591040, 3266445312, 3263823872, 3260284928, 3256352768, 3251109888,
3243245568, 3212836864, 1092616192, 1102053376, 1108082688, 1111752704, 1115815936, 1118175232, 1120927744,
1123942400, 3263037440, 3260022784, 3257270272, 3254910976, 3250847744, 3247177728, 3241148416, 3231711232,
1056964608, 1087373312, 1095237632, 1100480512, 1104412672, 1107951616, 1110573056, 1113718784, 1113718784,
1110573056, 1107951616, 1104412672, 1100480512, 1095237632, 1087373312, 1056964608, 3231711232, 3241148416,
3247177728, 3250847744, 3254910976, 3257270272, 3260022784, 3263037440, 3070099456, 3067084800, 3064332288,
3061972992, 3057909760, 3054239744, 3048210432, 3038773248, 864026624, 894435328, 902299648, 907542528,
911474688, 915013632, 917635072, 920780800, 920780800, 917635072, 915013632, 911474688, 907542528,
902299648, 894435328, 864026624, 3038773248, 3048210432, 3054239744, 3057909760, 3061972992, 3064332288,
3067084800, 3070099456, 0, 0, 0, 0, 0, 0, 0, 0, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648,
2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648,
2147483648, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0,
],
},
DecodeCase {
name: "scale-domains",
encoded: [
0, 0, 240, 225, 210, 195, 180, 165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 15, 0, 4, 240, 225, 210, 195,
180, 165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 15, 255, 123, 240, 225, 210, 195, 180, 165, 150, 135,
120, 105, 90, 75, 60, 45, 30, 15, 255, 251, 240, 225, 210, 195, 180, 165, 150, 135, 120, 105, 90, 75, 60,
45, 30, 15, 85, 53, 240, 225, 210, 195, 180, 165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 15,
],
expected_words: [
2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648, 2147483648,
2147483648, 2147483648, 3153985536, 3150970880, 3148218368, 3145859072, 3141795840, 3138125824, 3132096512,
3122659328, 947912704, 978321408, 986185728, 991428608, 995360768, 998899712, 1001521152, 1004666880,
1004666880, 1001521152, 998899712, 995360768, 991428608, 986185728, 978321408, 947912704, 3122659328,
3132096512, 3138125824, 3141795840, 3145859072, 3148218368, 3150970880, 3153985536, 3405635648, 3402622464,
3399871296, 3397513152, 3393447808, 3389779584, 3383749120, 3374312448, 1199562752, 1229972992, 1237837568,
1243081984, 1247012224, 1250553536, 1253173696, 1256317888, 1256317888, 1253173696, 1250553536, 1247012224,
1243081984, 1237837568, 1229972992, 1199562752, 3374312448, 3383749120, 3389779584, 3393447808, 3397513152,
3399871296, 3402622464, 3405635648, 1258152000, 1255138816, 1252387648, 1250029504, 1245964160, 1242295936,
1236265472, 1226828800, 3347046400, 3377456640, 3385321216, 3390565632, 3394495872, 3398037184, 3400657344,
3403801536, 3403801536, 3400657344, 3398037184, 3394495872, 3390565632, 3385321216, 3377456640, 3347046400,
1226828800, 1236265472, 1242295936, 1245964160, 1250029504, 1252387648, 1255138816, 1258152000, 3257486016,
3255476736, 3252504448, 3249359488, 3246563968, 3241844480, 3236600832, 3226814464, 1051369472, 1082827264,
1090866432, 1095409152, 1099779200, 1102574720, 1106069120, 1108779328, 1108779328, 1106069120, 1102574720,
1099779200, 1095409152, 1090866432, 1082827264, 1051369472, 3226814464, 3236600832, 3241844480, 3246563968,
3249359488, 3252504448, 3255476736, 3257486016,
],
},
];
pub const RAW_WRAP_CONTEXT: [u64; 3] = [18446744073709551615, 18446744073709551614, 18446744073709551613];
pub const RAW_WRAP_MIXED: [u64; 2] = [53991755950561, 18446703520432350442];
// Raw wrap fixture is primitive-only: invalid token IDs must still refuse.
// Gate probes: CPU host C libm only; not installed CUDA proof.
pub const GATE_CASES: &[(u32, u32)] = &[
(3212836864, 1049211569),
(2961797215, 1056956220),
(2147483648, 1056964608),
(0, 1056964608),
(814313567, 1056968802),
(1065353216, 1060841128),
];
pub const BF16_ROUND_CASES: &[(u32, u16)] =
&[(0, 0), (2147483648, 32768), (1065353216, 16256), (1065385984, 16256), (1065451520, 16258), (3212869632, 49024)];
pub const RESIDUAL_RIVAL: [u32; 5] = [1266679808, 3414163456, 1060841128, 1060841128, 1065353216];