// noesa24_avx2.cpp — IKNN-Rl1-A1 — NoeSA-24 AVX2 Kernel (Ryzen5 5650U) // Version: v1.0 // Created: 2026-09-03T17:10:00+07:00 // Last Updated: 2026-09-03T17:10:00+07:00 // Status: PUBLISHABLE — EN ONLY — M1 Kernel Validation // Repo: IKNN-Rl1-A1 — Integrated Knowledge-phase Neural Network — Recursive Language Iteration 1 — Architecture 1 // Hardware: Ryzen5 5650U — 6C/12T Zen3, AVX2 (NO AVX-512), DDR4 35-45GB/s // Description: Same as AVX-512 but AVX2 version — LUT576 decode 12 cycles per 13 units #include "noesa24_common.h" #include #include namespace iknn { namespace noesa24 { namespace avx2 { // AVX2 version — processes 8 activations at once (256-bit / 32-bit = 8) inline __m256i compute_noesa24_block_avx2( __m256i activations, // 8x INT32 const uint8_t states[8], int32_t bias_0b = 1) { alignas(32) int32_t act_array[8]; _mm256_store_si256(reinterpret_cast<__m256i*>(act_array), activations); alignas(32) int32_t result[8]; for (int i = 0; i < 8; ++i) { result[i] = compute_noesa24_single(static_cast(act_array[i]), states[i], bias_0b); } return _mm256_load_si256(reinterpret_cast(result)); } inline void decode_60bit_avx2(uint64_t packed60, uint8_t out_digits[13]) { static LUT576 lut[576]; static bool lut_built = false; if (!lut_built) { build_lut576(lut); lut_built = true; } unpack_13x24_lut(packed60, out_digits, lut); } } // namespace avx2 } // namespace noesa24 } // namespace iknn #ifdef NOESA24_AVX2_TEST #include #include int main() { using namespace iknn::noesa24; using namespace iknn::noesa24::avx2; std::cout << "[NoeSA-24 AVX2 Test] Ryzen5 5650U" << std::endl; std::mt19937 rng(42); uint8_t digits[13]; for (int i = 0; i < 13; ++i) digits[i] = rng() % 24; uint64_t packed = pack_13x24(digits); uint8_t unpacked[13]; unpack_13x24(packed, unpacked); bool ok = true; for (int i = 0; i < 13; ++i) if (digits[i] != unpacked[i]) ok = false; std::cout << "Pack/unpack: " << (ok ? "[PASS]" : "[FAIL]") << std::endl; int8_t act = 10; uint8_t state = encode_state(Operator::POS_A, Scale::S2); int32_t res = compute_noesa24_single(act, state); std::cout << "Compute +1a S2: " << res << " expected 40 " << (res==40 ? "[PASS]" : "[FAIL]") << std::endl; return 0; } #endif