MCPcopy Create free account
hub / github.com/Niko1221/Strata / tap_value

Function tap_value

engine/src/core/dflash2_ring_test.cpp:37–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35constexpr int kTap = 12800; // 5 taps x 2560
36
37float tap_value(uint32_t lineage, int64_t pos, int i) {
38 uint32_t x = (uint32_t) pos * 2654435761u ^ (uint32_t) i * 40503u ^ lineage * 97531u;
39 x ^= x >> 15; x *= 2246822519u; x ^= x >> 13; x *= 3266489917u; x ^= x >> 16;
40 return ((float) (x & 0xFFFF) / 32768.0f - 1.0f) * (1.0f + 0.25f * (float) (i % 7));
41}
42
43// feeds the rows [from, to) of `lineage` (tokens: token_of(lineage, pos)) as context updates, 256 rows a call, and notes the tokens
44int32_t token_of(uint32_t lineage, int64_t pos) { return (int32_t) (1000 + ((uint32_t) pos * 7919u + lineage * 104729u) % 50000u); }

Callers 1

feedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected