← Back to Pull requests

[rocjitsu] Match hardware transcendental results #12510

Merged
kuhar merged 36 files (9297 lines) on Sep 30, 2026 19:36 UTC
View on GitHub
kuhar kuhar commented on Sep 30, 2026 00:21 UTC
Author

Replace host approximations with hardware-derived F32 LOG, EXP, SIN/COS, RCP, RSQ and SQRT mappings. Match scalar and vector F32 results. Apply F16 denormal and finite-overflow policies before output modifiers, and preserve host floating-point state and architecture-specific NaN behavior.

Retain physical RDNA3/RDNA4 witnesses, exhaustive input digests and cross-target MODE/modifier tests. Other targets share the ISA-compatible approximation; bit-identical hardware results are qualified on RDNA3/4. Validate scalar and SIMD paths with Clang and GCC, including ASan and UBSan.

Issue #12429.

Diff: 9297 lines (+6124 / -3173) across 36 files Reviewer: sjain-stanford Review duration: 1154m
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.72) × (1 − Review Confidence (0.70)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.72 · 9297 lines diff across 36 files
0.72
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.42 · 5 substantive comment(s)
0.42
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
70%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.400
Mass File Touch mass_file_touch
0.080
Real PR Conversation Timeline
9 items
therock-pr-bot[bot] therock-pr-bot[bot] commented on Sep 30, 2026 00:25 UTC
Bot

<!-- therock-pr-bot-policy-check -->

✅ All Checks Passed — Ready for Review

| Check | Status | Details |
|---|:---:|---|
| 📝 PR Description | ✅ Pass | — |
| ⛔ Forbidden Files | ✅ Pass | — |
| 🧪 Unit Test | ✅ Pass | — |
| 🔎 pre-commit | ✅ Pass | — |
| 🚫 Draft PR | 🔜 To Be Enabled | — |
| 🚩 Feature Flag | 🔜 To Be Enabled | — |
| 📊 Code Coverage | 🔜 To Be Enabled | — |
| 🤖 therock-pr-bot | ✅ Pass | — |

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

therock-pr-bot[bot] therock-pr-bot[bot] commented on Sep 30, 2026 00:26 UTC
Bot

<!-- therock-pr-bot-fix-policies -->
🎉 All checks passed! This PR is ready for review.

sjain-stanford sjain-stanford commented on code on Sep 30, 2026 01:13 UTC
Code Review
emulation/rocjitsu/lib/util/include/util/amdgpu_rsq.h:1
@@ -0,0 +1,405 @@
+// Copyright (c) 2026 Advanced Micro Devices, Inc.
+// SPDX-License-Identifier: MIT
+
+#pragma once
+
+/// @file
+/// @brief Shared reciprocal-square-root mapping for AMDGPU instruction execution.
+
+#include "util/big_int.h"
+
+#include <bit>
+#include <cstdint>
+
+namespace util::detail {
+
+// A fixed-point cubic and sparse one-ULP residuals reproduce all normalized
+// outputs captured on physical gfx1100 and gfx1201. This is an empirical
+// mapping, not a claim about the hardware implementation. The complete mapping
+// stays within the ISA's one-ULP bound. Coefficients use quarter units of the
+// result's FP32 ULP; index combines exponent parity and the input mantissa.
+inline uint32_t amdgpu_rsq_polynomial(uint32_t index) {
+  struct Coefficient {
+    uint32_t constant;
+    uint32_t linear;
+    uint16_t quadratic;
+    uint16_t cubic;
+  };
+  static constexpr Coefficient coefficients[] = {
+      {67108864u, 1048572u, 24555u, 606u}, {66084241u, 1001273u, 22738u, 545u},
+      {65105161u, 957426u, 21104u, 491u},  {64168347u, 916688u, 19629u, 445u},
+      {63270843u, 878759u, 18295u, 403u},  {62409975u, 843376u, 17084u, 367u},
+      {61583317u, 810305u, 15983u, 335u},  {60788660u, 779340u, 14978u, 306u},
+      {60023992u, 750298u, 14060u, 280u},  {59287474u, 723016u, 13219u, 257u},
+      {58577418u, 697349u, 12446u, 237u},  {57892279u, 673165u, 11735u, 218u},
+      {57230631u, 650347u, 11080u, 201u},  {56591163u, 628789u, 10475u, 186u},
+      {55972661u, 608397u, 9915u, 173u},   {55374006u, 589084u, 9396u, 160u},
+      {54794158u, 570771u, 8914u, 149u},   {54232151u, 553388u, 8467u, 139u},
+      {53687091u, 536870u, 8050u, 129u},   {53158141u, 521157u, 7661u, 121u},
+      {52644524u, 506196u, 7298u, 113u},   {52145512u, 491938u, 6959u, 105u},
+      {51660427u, 478336u, 6641u, 99u},    {51188632u, 465350u, 6343u, 93u},
+      {50729532u, 452941u, 6064u, 87u},    {50282567u, 441074u, 5802u, 82u},
+      {49847212u, 429717u, 5555u, 77u},    {49422973u, 418838u, 5322u, 73u},
+      {49009384u, 408411u, 5103u, 68u},    {48606008u, 398409u, 4897u, 65u},
+      {48212431u, 388809u, 4702u, 61u},    {47828262u, 379589u, 4517u, 58u},
+      {47453132u, 741452u, 17363u, 428u},  {46728614u, 708007u, 16078u, 385u},
+      {46036300u, 677002u, 14922u, 347u},  {45373873u, 648196u, 13880u, 314u},
+      {44739242u, 621376u, 12936u, 285u},  {44130517u, 596356u, 12080u, 259u},
+      {43545981u, 572972u, 11301u, 236u},  {42984073u, 551076u, 10591u, 216u},
+      {42443372u, 530541u, 9942u, 198u},   {41922574u, 511250u, 9347u, 182u},
+      {41420490u, 493100u, 8801u, 167u},   {40936023u, 475999u, 8298u, 154u},
+      {40468167u, 459864u, 7835u, 142u},   {40015995u, 444621u, 7407u, 132u},
+      {39578648u, 430202u, 7011u, 122u},   {39155335u, 416545u, 6644u, 113u},
+      {38745320u, 403596u, 6303u, 105u},   {38347922u, 391304u, 5987u, 98u},
+      {37962506u, 379624u, 5692u, 91u},    {37588482u, 368514u, 5417u, 85u},
+      {37225300u, 357935u, 5160u, 80u},    {36872445u, 347852u, 4920u, 74u},
+      {36529438u, 338235u, 4696u, 70u},    {36195829u, 329052u, 4485u, 65u},
+      {35871196u, 320278u, 4288u, 61u},    {35555144u, 311887u, 4102u, 58u},
+      {35247302u, 303855u, 3928u, 54u},    {34947319u, 296163u, 3763u, 51u},
+      {34654868u, 288790u, 3609u, 48u},    {34369638u, 281718u, 3462u, 45u},
+      {34091337u, 274930u, 3325u, 43u},    {33819688u, 268410u, 3194u, 41u},
+  };
+  const Coefficient coefficient = coefficients[index >> 18];
+  const uint32_t fraction = index & 0x3ffffu;
+  const uint64_t product = uint64_t{coefficient.linear} * fraction;
+  const unsigned shift = product >= (uint64_t{1} << 37) ? 14 : 13;
+  const uint64_t quotient = product >> shift;
+  const uint64_t remainder = product & ((uint64_t{1} << shift) - 1);
+  const uint64_t midpoint = uint64_t{1} << (shift - 1);
+  const uint64_t linear =
+      (quotient + (remainder > midpoint || (remainder == midpoint && (quotient & 1))))
+      << (shift - 13);
+  const uint64_t inner =
+      (uint64_t{coefficient.quadratic} << 18) - uint64_t{coefficient.cubic} * fraction;
+  const uint32_t square_input = fraction & ~1u;
+  const uint64_t quadratic =
+      static_cast<uint64_t>((uint128_t{inner} * square_input * square_input) >> 51);
+  return 0x3e800000u +
+         static_cast<uint32_t>(
+             (uint64_t{coefficient.constant} * 32 - linear + quadratic * 4 + 64) >> 7);
+}
+
+// Each bucket covers fifteen low index bits; the residual high bit selects
+// +1 rather than -1 ULP. Both exponent parities have their own buckets.
+inline constexpr uint16_t kAmdgpuRsqCorrectionOffsets[] = {
+    0x0000, 0x0004, 0x000b, 0x0011, 0x0018, 0x001b, 0x0022, 0x002d, 0x0036, 0x003e, 0x0049, 0x004f,
+    0x0055, 0x005d, 0x0064, 0x006a, 0x0071, 0x0074, 0x007b, 0x0088, 0x008f, 0x0093, 0x0098, 0x00a0,
+    0x00a9, 0x00b1, 0x00b6, 0x00bd, 0x00c2, 0x00ca, 0x00d2, 0x00d8, 0x00e1, 0x00e6, 0x00e9, 0x00ee,
+    0x00f5, 0x00fb, 0x0106, 0x010f, 0x0113, 0x011b, 0x0121, 0x0122, 0x0129, 0x0130, 0x0131, 0x0138,
+    0x0145, 0x0148, 0x014c, 0x014f, 0x0157, 0x015f, 0x0163, 0x016d, 0x0176, 0x017d, 0x0181, 0x0186,
+    0x018e, 0x0191, 0x0198, 0x019c, 0x01a0, 0x01a5, 0x01ab, 0x01ae, 0x01b5, 0x01b9, 0x01c1, 0x01c8,
+    0x01d1, 0x01d6, 0x01dc, 0x01e0, 0x01e4, 0x01e7, 0x01e9, 0x01eb, 0x01f4, 0x01ff, 0x0205, 0x0205,
+    0x020a, 0x020c, 0x0211, 0x0219, 0x021d, 0x0221, 0x0227, 0x022c, 0x022f, 0x0233, 0x0237, 0x023b,
+    0x0240, 0x0247, 0x024b, 0x0253, 0x0256, 0x0258, 0x025a, 0x025b, 0x0260, 0x0264, 0x026b, 0x026f,
+    0x0271, 0x0273, 0x0279, 0x027b, 0x027e, 0x0281, 0x0282, 0x0285, 0x0289, 0x0291, 0x0294, 0x0299,
+    0x029e, 0x02a3, 0x02a3, 0x02a8, 0x02aa, 0x02ae, 0x02b2, 0x02b7, 0x02bd, 0x02c8, 0x02cb, 0x02d2,
+    0x02d4, 0x02d5, 0x02d7, 0x02d9, 0x02dc, 0x02df, 0x02e4, 0x02e7, 0x02ef, 0x02f5, 0x02fa, 0x02ff,
+    0x0304, 0x030a, 0x0310, 0x0312, 0x0314, 0x0315, 0x031b, 0x031e, 0x0322, 0x0325, 0x0326, 0x0329,
+    0x032b, 0x032e, 0x0330, 0x0335, 0x033c, 0x0345, 0x034a, 0x034d, 0x0350, 0x0356, 0x035c, 0x035e,
+    0x0363, 0x036b, 0x036f, 0x0373, 0x037c, 0x037f, 0x0385, 0x0388, 0x0388, 0x038d, 0x0391, 0x0393,
+    0x0394, 0x039a, 0x03a0, 0x03a5, 0x03ab, 0x03ae, 0x03b0, 0x03b2, 0x03b6, 0x03bc, 0x03c1, 0x03c5,
+    0x03cb, 0x03d1, 0x03d3, 0x03d8, 0x03de, 0x03e1, 0x03e5, 0x03ef, 0x03f4, 0x03fd, 0x0400, 0x0404,
+    0x0408, 0x040b, 0x040e, 0x0411, 0x0419, 0x0421, 0x0426, 0x0427, 0x042e, 0x042f, 0x0431, 0x0434,
+    0x0439, 0x043d, 0x0441, 0x0444, 0x0447, 0x0449, 0x044f, 0x0457, 0x045c, 0x0461, 0x0466, 0x0468,
+    0x046b, 0x0470, 0x0471, 0x0474, 0x047b, 0x0481, 0x0484, 0x0487, 0x048a, 0x048f, 0x0494, 0x0499,
+    0x049e, 0x04a2, 0x04a7, 0x04b1, 0x04b5, 0x04b7, 0x04b9, 0x04c0, 0x04c4, 0x04c7, 0x04c9, 0x04cc,
+    0x04d1, 0x04d4, 0x04d7, 0x04da, 0x04dd, 0x04e8, 0x04f1, 0x04f7, 0x04fb, 0x0500, 0x0505, 0x050c,
+    0x0514, 0x0517, 0x0519, 0x0521, 0x0528, 0x052e, 0x0537, 0x053f, 0x0544, 0x0549, 0x054c, 0x0550,
+    0x055a, 0x055f, 0x0566, 0x0568, 0x0577, 0x057c, 0x0580, 0x0581, 0x0586, 0x058c, 0x058f, 0x0599,
+    0x05a6, 0x05b1, 0x05b1, 0x05b4, 0x05bb, 0x05c2, 0x05cd, 0x05d5, 0x05d8, 0x05dd, 0x05e1, 0x05e6,
+    0x05e9, 0x05ee, 0x05f4, 0x05fa, 0x0600, 0x0608, 0x0609, 0x060d, 0x060f, 0x0614, 0x0619, 0x0621,
+    0x0624, 0x0627, 0x062b, 0x0630, 0x0634, 0x0638, 0x063c, 0x0643, 0x064b, 0x064d, 0x0650, 0x0655,
+    0x0655, 0x0658, 0x0660, 0x0666, 0x0669, 0x066e, 0x0672, 0x067a, 0x067d, 0x067f, 0x0681, 0x0685,
+    0x0689, 0x0690, 0x0691, 0x0696, 0x0699, 0x069f, 0x06a6, 0x06ab, 0x06b5, 0x06ba, 0x06be, 0x06c1,
+    0x06c6, 0x06ca, 0x06ce, 0x06d0, 0x06d3, 0x06d9, 0x06dd, 0x06e2, 0x06e5, 0x06e8, 0x06ec, 0x06ef,
+    0x06f3, 0x06fd, 0x0701, 0x0705, 0x0709, 0x070d, 0x0713, 0x0718, 0x071b, 0x071e, 0x0721, 0x0723,
+    0x0727, 0x072d, 0x072f, 0x0736, 0x073c, 0x0742, 0x0744, 0x074b, 0x074f, 0x0754, 0x0758, 0x075b,
+    0x0762, 0x0766, 0x0769, 0x076e, 0x0776, 0x0778, 0x077b, 0x077f, 0x0785, 0x0790, 0x0794, 0x0796,
+    0x079c, 0x07a4, 0x07aa, 0x07ae, 0x07b5, 0x07b8, 0x07be, 0x07c3, 0x07c6, 0x07ca, 0x07cd, 0x07d4,
+    0x07d9, 0x07e2, 0x07e6, 0x07ec, 0x07f0, 0x07f3, 0x07fa, 0x07fe, 0x0804, 0x080a, 0x080f, 0x0810,
+    0x0817, 0x081c, 0x0820, 0x0829, 0x0832, 0x0835, 0x083b, 0x083c, 0x0840, 0x0843, 0x0845, 0x0849,
+    0x084c, 0x084d, 0x0852, 0x0855, 0x0856, 0x0859, 0x0862, 0x086a, 0x0873, 0x087b, 0x087f, 0x0884,
+    0x0888, 0x088c, 0x088d, 0x088e, 0x0893, 0x0897, 0x089b, 0x089c, 0x08a1, 0x08a4, 0x08a8, 0x08b0,
+    0x08b9, 0x08bf, 0x08c0, 0x08c3, 0x08c5, 0x08c7, 0x08c9, 0x08d0, 0x08d4, 0x08d9, 0x08db, 0x08e1,
+    0x08e4, 0x08e7, 0x08ea, 0x08ed, 0x08f0, 0x08f9, 0x08fe, 0x0906, 0x0908, 0x090a, 0x0910, 0x0912,
+    0x0915, 0x0919, 0x091b, 0x091d, 0x091f, 0x0923, 0x0926, 0x092c, 0x0933, 0x093b, 0x093e, 0x0943,
+    0x0947, 0x094c, 0x094d, 0x0956, 0x0957, 0x0960, 0x0967, 0x096d, 0x096d, 0x0970, 0x0978, 0x097c,
+    0x0981, 0x0989, 0x098b, 0x0994, 0x099a, 0x099f, 0x09a7, 0x09ad, 0x09b4,
+};
+inline constexpr uint16_t kAmdgpuRsqCorrections[] = {
+    0x1bbc, 0x5dd1, 0x65b4, 0x7dce, 0x3ee0, 0x53d1, 0x6c65, 0x7a8d, 0x7ae4, 0x7d47, 0x7df5, 0x19a7,
+    0x51b2, 0x51b3, 0x5b8b, 0x5cc6, 0x74ff, 0x3e99, 0x4cf2, 0x552a, 0x5ab0, 0x5ab1, 0x7273, 0x7859,
+    0x0eca, 0x1c7e, 0x70cb, 0x0507, 0x15c3, 0x26dc, 0x3b93, 0x3e72, 0x3e73, 0x67ae, 0x01e6, 0x03d7,
+    0x0eeb, 0x10d3, 0x1129, 0x2b29, 0x3281, 0x4b66, 0x5fbd, 0x668c, 0x79b1, 0x3007, 0x4295, 0x5ef2,
+    0x5ef3, 0x64d4, 0xeb09, 0x6d6b, 0x6f5b, 0x742e, 0x0006, 0x0032, 0x0a31, 0x1eab, 0x4abb, 0x51fe,
+    0x5572, 0x61ba, 0x0a96, 0x118b, 0x1546, 0x1ba4, 0x3b70, 0x4547, 0xccb7, 0x539b, 0x69fa, 0x6d2c,
+    0x7693, 0x000c, 0x014e, 0x2a1e, 0x3d61, 0x4d46, 0x679e, 0x0caf, 0x0db2, 0x0fb8, 0x438a, 0x56e9,
+    0x648d, 0x3693, 0x3c33, 0xc941, 0x4aa9, 0x5149, 0x5a73, 0x68c5, 0x78e4, 0x0b78, 0x0fcd, 0x294d,
+    0x30f6, 0x3f4a, 0x5874, 0x6df2, 0x192c, 0x1c7c, 0x2bc5, 0x3902, 0x410c, 0x5c09, 0x05e6, 0x095f,
+    0x3286, 0x3e6a, 0x42a0, 0x4727, 0x5890, 0x001a, 0x21ba, 0x35c7, 0x0db6, 0x27c2, 0x2ac4, 0x46a6,
+    0x4e6f, 0x5d3c, 0x6d4a, 0x023d, 0x0827, 0x8be3, 0x29d7, 0x2a5b, 0x2db9, 0x3ca5, 0x3d32, 0x4859,
+    0x6852, 0x6da8, 0x6eb3, 0xfffb, 0x0f96, 0x38c4, 0x39db, 0x3ad5, 0xc9f4, 0x4d59, 0x6f24, 0x84c0,
+    0x1713, 0x275e, 0x4889, 0x0d75, 0x9000, 0x1da9, 0x4ca9, 0x5731, 0x037b, 0x1468, 0x23af, 0x30b4,
+    0x3a58, 0x43c2, 0x591e, 0x5d8e, 0x1288, 0x154a, 0x303c, 0x4c9b, 0xe8bd, 0x6915, 0x737a, 0x778f,
+    0x7a44, 0x000e, 0x001e, 0x10c1, 0x22e1, 0x25a5, 0xa7e3, 0x49ec, 0x6b4d, 0x0647, 0x19d6, 0x251e,
+    0x2553, 0x3fab, 0x83a3, 0x099d, 0x9309, 0x1eee, 0x5afc, 0x5cb5, 0x6764, 0x9201, 0x46cf, 0x4eda,
+    0x568d, 0x6cd3, 0x0346, 0x0e32, 0x2f31, 0x35f6, 0x37ac, 0x4075, 0x711e, 0x7785, 0x03c5, 0x0793,
+    0x0ead, 0x1fd1, 0x306c, 0x3ce6, 0x69a9, 0x7db0, 0x024e, 0x0458, 0x0a6e, 0x2c8d, 0x4d1c, 0x4e70,
+    0x02cb, 0x36f3, 0x4b6f, 0x4ba1, 0x4fad, 0x5951, 0x5d60, 0x5e21, 0x688a, 0x0011, 0x0030, 0x3afd,
+    0x3e6b, 0x52b5, 0xa445, 0x5af4, 0xde81, 0x0926, 0x09a1, 0x20e3, 0x22af, 0x7fa2, 0x1263, 0x1b4e,
+    0x20e7, 0x2960, 0x2b8c, 0x74fe, 0x7f5d, 0x14df, 0x97ef, 0x5d17, 0x5ead, 0x78ca, 0x7ab0, 0x0858,
+    0x1067, 0x15f2, 0x1c5a, 0x20a2, 0x211f, 0x38f2, 0x56e3, 0x5aea, 0x5def, 0x6736, 0x0afd, 0x0b82,
+    0x2606, 0x3cc0, 0x3efa, 0x4eb4, 0x53e7, 0x5c76, 0x7bc2, 0x374d, 0x627a, 0x751a, 0x75c8, 0x0009,
+    0x1114, 0xbb41, 0x4914, 0x6594, 0x6703, 0x71d7, 0x7a11, 0x0e3c, 0x2029, 0x220c, 0x4924, 0x5738,
+    0x6fa7, 0x5059, 0x1df3, 0x32eb, 0xd5c7, 0x56be, 0x7908, 0xf9a4, 0x7bac, 0x9bbd, 0x27ac, 0x2f93,
+    0x4205, 0x49ac, 0x5a07, 0x6d45, 0x1d4a, 0x108c, 0x93f9, 0x365e, 0x4628, 0x50dd, 0x512e, 0x5efb,
+    0x1567, 0x2c6f, 0x4739, 0x47be, 0x4cbf, 0x50fc, 0x5750, 0x5c2b, 0x5ecb, 0x6a37, 0x6cda, 0x7347,
+    0x7523, 0x0020, 0x4086, 0x56f1, 0x0dd6, 0x34ee, 0x7547, 0x7cf4, 0x02a9, 0x3b35, 0x4a78, 0x0e44,
+    0x2506, 0x5af5, 0x64fa, 0x65c5, 0xf28a, 0x72c8, 0x79d2, 0x84de, 0x1aa1, 0x278b, 0x480c, 0x4dc9,
+    0x5617, 0x6b0e, 0x6fb4, 0x132b, 0x3e38, 0x4f3c, 0x6d0b, 0x0b68, 0x0b90, 0x0bb8, 0x1358, 0x13c8,
+    0x2b85, 0xcd61, 0x52bb, 0x581c, 0x5bdc, 0x8f60, 0x1184, 0x1255, 0x14b0, 0x251d, 0xaebe, 0x4336,
+    0xf2a4, 0x7c38, 0x0029, 0x25e7, 0xbc03, 0x5fc4, 0xedc6, 0x752b, 0xf875, 0x97f1, 0x713c, 0x7985,
+    0xfcf1, 0xb33e, 0x44b5, 0x4513, 0x4562, 0x7f67, 0x83ba, 0x0ce5, 0x9407, 0x9d66, 0x1dc7, 0x244d,
+    0x5f9e, 0x65f4, 0x9307, 0x51a8, 0x6a3c, 0x2ced, 0x52bb, 0x6171, 0x6355, 0x6a69, 0x76b9, 0x7ea9,
+    0x2818, 0x4f82, 0x6725, 0xf35e, 0x1b04, 0x1fec, 0x2985, 0x3e4e, 0x002c, 0x003a, 0x09a8, 0x1f73,
+    0x4d9b, 0x031a, 0x314a, 0x37a0, 0x5bc6, 0x618c, 0x7b7c, 0x01d5, 0x3185, 0xf3bd, 0x02e9, 0x21db,
+    0x28da, 0x3ad5, 0x42a5, 0x5ce8, 0x6ee6, 0x358c, 0x5bd0, 0x7455, 0x7deb, 0x11f6, 0x9bfa, 0x1d2b,
+    0x21c7, 0x334e, 0x5313, 0x74db, 0x7ef8, 0x13b9, 0x1874, 0x2b2e, 0x40de, 0x7264, 0x797a, 0x7e76,
+    0x3642, 0x3fcc, 0x4463, 0xc4c4, 0x5345, 0xdf5c, 0x6536, 0x686d, 0x69e0, 0x0000, 0x001d, 0x003a,
+    0x1140, 0x3b32, 0x1ad9, 0x34e6, 0x4a0b, 0x4fbd, 0x51cb, 0x79fe, 0x05eb, 0x077f, 0x917d, 0x5bbb,
+    0x0a49, 0x19d6, 0x63c2, 0x6495, 0x2607, 0x3baa, 0xe18d, 0x091e, 0x1710, 0x0cfe, 0xe78f, 0x0d2b,
+    0x24a3, 0x2aea, 0x3593, 0x3605, 0x3ecf, 0x5ee8, 0x6731, 0x7b7e, 0x0000, 0x0003, 0x0006, 0x0009,
+    0x000c, 0x000f, 0xaf63, 0x4343, 0xd82d, 0x6b4d, 0x72c4, 0x1de2, 0x28fd, 0x4216, 0x583c, 0x5ea8,
+    0xe586, 0x24fd, 0x31c5, 0xbccc, 0x5542, 0x709a, 0x25ee, 0x545a, 0x94ce, 0x3190, 0x524b, 0x5b68,
+    0x6395, 0x0b5b, 0x2654, 0x2978, 0x38dd, 0x5439, 0x66c8, 0x6e91, 0x7702, 0x1e95, 0x5773, 0xe6d2,
+    0x6cb0, 0x003a, 0x077b, 0x08d8, 0xe111, 0x405a, 0x547f, 0xde8b, 0xe901, 0x6bc2, 0xf4c5, 0x00d4,
+    0x045a, 0x2e78, 0x5b9d, 0x67a7, 0x21ff, 0xc9ec, 0x7e84, 0xc68f, 0x58b1, 0xdf05, 0x7016, 0x071d,
+    0x306d, 0xb73f, 0x6002, 0x88f0, 0x513f, 0x7b79, 0x7c30, 0x2513, 0x3333, 0x463f, 0x49c1, 0xea92,
+    0x0002, 0x001f, 0x145a, 0x2de8, 0x36bd, 0x61da, 0x7aa8, 0x2ebc, 0x39d9, 0x5328, 0x797a, 0x031b,
+    0x0b8b, 0x22b5, 0x2f40, 0x410b, 0x5e98, 0x78ef, 0x7e44, 0x9722, 0x1aad, 0x60f6, 0x37c5, 0x586a,
+    0x0b92, 0x1111, 0x7740, 0x0632, 0x424c, 0xc520, 0xd2e6, 0x5d89, 0x1a01, 0x1e70, 0xdfb8, 0x7858,
+    0x15d0, 0x2291, 0x23ae, 0x24cb, 0x491c, 0x583f, 0xdbfe, 0x1f77, 0x4685, 0x5693, 0x6530, 0x1403,
+    0x984f, 0x2e99, 0x4ca2, 0x3078, 0x3df9, 0x3fb8, 0x43e4, 0x73ea, 0x78b5, 0x6851, 0x76ed, 0x0d4f,
+    0x466b, 0xf7ca, 0x0035, 0x03a4, 0x4042, 0x4ce8, 0x3d95, 0x3dfa, 0xffe9, 0x318e, 0x49b3, 0xde9a,
+    0x738f, 0x26d1, 0x2bf1, 0xac5c, 0xc2b8, 0x4315, 0x61ed, 0x678e, 0x7e49, 0x1fa6, 0x45a0, 0x6fcc,
+    0x1839, 0x3912, 0x5cbf, 0x6900, 0x7b13, 0x9178, 0x28b6, 0x3a3d, 0x4d0a, 0x747b, 0x0010, 0x0e79,
+    0xab40, 0xd20e, 0x5d4d, 0x13cf, 0x3068, 0x491c, 0xdf7a, 0x7b43, 0x45e9, 0xea5e, 0x8b70, 0x521b,
+    0x5a7e, 0x7cd7, 0x1ed0, 0xa442, 0x5d63, 0x6e26, 0x895a, 0x0f33, 0x2f16, 0xd2ae, 0x5416, 0x32ff,
+    0x3b30, 0x3e69, 0xc867, 0x4ce5, 0x7fbc, 0x8cb8, 0xa1e0, 0x22f2, 0x2e5b, 0x38c7, 0x4cd7, 0xcf4b,
+    0x60c9, 0x75cf, 0x7858, 0xfa0d, 0x9735, 0x4d0e, 0x6291, 0x1d26, 0x2c87, 0x39f5, 0x5110, 0x5b0e,
+    0x6bf5, 0x6dd8, 0x6a6d, 0x79ee, 0x01a4, 0x01aa, 0x38cf, 0x3273, 0x5058, 0x9540, 0x2bbd, 0x4c32,
+    0x003f, 0x1e7d, 0x52c6, 0x0132, 0x82de, 0x15e7, 0xc402, 0x5652, 0x0639, 0x1681, 0x3b05, 0x019c,
+    0x07d3, 0x0a44, 0x0c9e, 0x1c33, 0x1e95, 0x5a8a, 0x7a66, 0x2825, 0x4c3e, 0x52fc, 0x616c, 0x6299,
+    0x68ee, 0x0b66, 0xa9cd, 0x53a2, 0x6939, 0x79fb, 0xaeb9, 0x43b2, 0xd80b, 0x6048, 0x7c5a, 0x0189,
+    0x901e, 0x9243, 0x1f18, 0xa1b4, 0x0014, 0x2331, 0x2ab9, 0x311c, 0x5274, 0x7816, 0x176e, 0x9de0,
+    0xbe7f, 0x7405, 0xf78c, 0xfc44, 0x346d, 0x4c31, 0xa1e9, 0x6976, 0x379f, 0x08c2, 0x1715, 0x3699,
+    0x4f63, 0x5539, 0x785e, 0xe4f3, 0x72a5, 0xfa51, 0x048d, 0x5f68, 0xecd4, 0x73e6, 0x0056, 0x005a,
+    0x9281, 0x6070, 0xaba0, 0x3ce7, 0x633b, 0x55c4, 0x57ce, 0x10f8, 0x4a19, 0x52e8, 0x6104, 0xf308,
+    0x20e0, 0x24dd, 0x2ef3, 0x33d3, 0x6064, 0x0052, 0x0dd6, 0x2bef, 0xc4c4, 0x6342, 0x69d9, 0xf725,
+    0x0001, 0x001e, 0x003b, 0x0058, 0x11fd, 0x52ab, 0x5dc8, 0xe15c, 0x74c8, 0x088c, 0x3b13, 0x3cc0,
+    0x4325, 0xf99c, 0x0203, 0x2316, 0xc1f2, 0x0c34, 0x8dab, 0xb126, 0x0d5f, 0x203d, 0x2341, 0x3a38,
+    0x4ad9, 0x6ac3, 0x8ca4, 0x164f, 0x248a, 0xaac4, 0x3b20, 0x7d00, 0xb872, 0x3ebb, 0x2178, 0xa96f,
+    0xc9cb, 0x743a, 0x75b1, 0x0021, 0x0786, 0x9760, 0x1951, 0x9ac2, 0x1c22, 0x1eb3, 0x4dae, 0x0b90,
+    0x1733, 0x3262, 0xf62e, 0x4afd, 0x4b28, 0x577a, 0x6d8a, 0x0dc4, 0xaf83, 0xc707, 0x4a46, 0x4e79,
+    0x631b, 0x6937, 0xeff1, 0x7225, 0x34ca, 0x4069, 0x67da, 0x0137, 0x0251, 0x1a6d, 0x2733, 0x3db4,
+    0x67ea, 0x04d6, 0x28c7, 0x56d4, 0x0028, 0x32de, 0x4c7b, 0x5aad, 0x6350, 0x9d41, 0x1fb0, 0x43cf,
+    0xc900, 0x1229, 0xc16c, 0x43e2, 0x975b, 0xa844, 0xafa3, 0xc07d, 0x6d8f, 0x7a92, 0x0cad, 0x2516,
+    0xcb23, 0x4fa2, 0x7b8a, 0xff4a, 0x9e3b, 0x2f21, 0xbddd, 0x77f0, 0x79ba, 0x8328, 0x07f9, 0x0926,
+    0xdb7f, 0xe21c, 0x72ba, 0x0050, 0x0059, 0x39e3, 0xec37, 0x705a, 0x3bb0, 0x4997, 0x0256, 0x1cdd,
+    0x2234, 0xf4f3, 0x8cb8, 0x8e41, 0x3fec, 0x5a95, 0xdabc, 0xe72b, 0x074f, 0x12f8, 0xac88, 0x3000,
+    0x4476, 0x291d, 0x35a2, 0x640f, 0xe982, 0xa039, 0xa25a, 0x583a, 0x59d1, 0x5e86, 0xfb7e, 0x000f,
+    0x129a, 0x19e5, 0xad54, 0xb670, 0x76d1, 0x0d28, 0x6ca2, 0x8aa5, 0x9eaf, 0x4033, 0xe10d, 0x64d2,
+    0x9760, 0xab5c, 0x2f4d, 0x682c, 0x742c, 0x7d22, 0x9093, 0x1453, 0x578a, 0x0148, 0x9c8e, 0xa041,
+    0x486d, 0x0728, 0x0c2d, 0x1db2, 0x3457, 0xbbb4, 0x4171, 0x575e, 0xf37a, 0x7522, 0x7c8e, 0xd3dd,
+    0x5c21, 0xe495, 0x711f, 0xf77b, 0x0029, 0x003c, 0x004f, 0x0aa3, 0x9bb9, 0x26a0, 0x3219, 0xb974,
+    0x3a6e, 0x3784, 0x46d2, 0x78dd, 0x13f5, 0xa4f9, 0x2b75, 0xaf01, 0x0e4f, 0x9b01, 0xb7f5, 0x3b71,
+    0xa932, 0xdb17, 0xf68b, 0x01b3, 0x3ab6, 0x6d74, 0x8a19, 0x28c1, 0xb2fc, 0x02eb, 0x05bb, 0x897c,
+    0xac4d, 0xcfbd, 0x5f19, 0x7350, 0xfe4d, 0x0032, 0x0059, 0x90d5, 0x9fdd, 0xa552, 0xde21, 0x6d07,
+    0xf42b, 0x838b, 0x9e9e, 0xa1df, 0x2c02, 0x6ce9, 0xf01a, 0x0a36, 0x935e, 0x9d5d, 0x2298, 0x2e9e,
+    0xe3da, 0xeee9, 0x84d8, 0x5805, 0xdaf1, 0x1593, 0x9e2e, 0xb1ed, 0x19f6, 0x1a0a, 0xc693, 0x532a,
+    0xff1e, 0x0052, 0x0057, 0x6150, 0x6ff1, 0x0ec4, 0x5143, 0xdc99, 0x677c, 0x09b0, 0x0f0b, 0xc179,
+    0xafa2, 0x3c51, 0x7eef, 0x5437, 0xd54c, 0x2afd, 0x51e5, 0x590b, 0x648e, 0xf160, 0x79b7, 0x1ec8,
+    0xa329, 0xb87e, 0x394d, 0xd463, 0x58c8, 0x5ea5, 0x72cf, 0x1e54, 0x32d8, 0x6898, 0x74af, 0xf8ce,
+    0x0032, 0x0056, 0x08c8, 0x13a3, 0x1ed6, 0x0ad5, 0x0cf2, 0x9226, 0x35f7, 0x7839, 0xdbb8, 0x68dc,
+    0xb220, 0xefd6, 0x7c99, 0x2012, 0xa29f, 0xc630, 0xe0af, 0x751e, 0x5977, 0x4260, 0x503c, 0x5887,
+    0x1d50, 0x452b, 0x49cf, 0x4a40, 0xd60a, 0xe030, 0x7f66, 0x0019, 0x002e, 0x26bb, 0x3a8e, 0xd84f,
+    0x7de1, 0xb9ae, 0xb9f8, 0xd81d, 0x8650, 0x6d14, 0x6ee2, 0x2663, 0xb89e, 0xf940, 0x205d, 0xb756,
+    0xd3f1, 0x5524, 0xf609, 0x16af, 0x9b55, 0x281c, 0xbe62, 0xf6db, 0x2768, 0xc40a, 0x443d, 0xd88f,
+    0x73f7, 0xd8e5, 0x6108, 0x6aa2, 0x702c, 0x795b, 0x130b, 0x4ab5, 0x57ec, 0x662d, 0x0d4f, 0x6a93,
+    0xeb0d, 0x6bd3, 0x790c, 0x1946, 0x2bfc, 0xbd35, 0xc8a1, 0x5263, 0x55ef, 0xdbd4, 0x5e53, 0x7b2f,
+    0x7f6a, 0x46a2, 0xdabb, 0x63e2, 0xf173, 0x8f7f, 0x4451, 0x356f, 0xff3e, 0x1e51, 0xa7be, 0xab6a,
+    0xc510, 0xd19d, 0x577e, 0xd92e, 0x90c4, 0x3f12, 0x400d, 0xe42c, 0x003a, 0x0045, 0x72bd, 0xc94e,
+    0x6080, 0x2c8a, 0xe5f6, 0x759f, 0x2f3d, 0x5bb5, 0xf004, 0x70d0, 0x76b5, 0x504c, 0x6281, 0x647f,
+    0x12ed, 0xe7ab, 0xeebd, 0xaeaa, 0xda8f, 0x6c9d, 0x8f01, 0xc214, 0xc498, 0x000c, 0x02c1, 0x9006,
+    0x16aa, 0x1aef, 0x2069, 0x3605, 0x41a7, 0x4add, 0x5d5d, 0x7e9c, 0x09b1, 0x10bb, 0x1230, 0xb444,
+    0x37a7, 0x4398, 0x6226, 0x74cb, 0x7f5c, 0x350d, 0x4359, 0x5286, 0x6798, 0x6f2d, 0x7c0e, 0x0ebc,
+    0x606a, 0x6738, 0xfb23, 0x22b7, 0x3785, 0x5fa6, 0x683b, 0x7f1d, 0x031e, 0x092a, 0x1539, 0x42dc,
+    0x50de, 0x0e0a, 0xad2f, 0x2f1c, 0x3e58, 0x4de3, 0xf460, 0xfde0, 0x2f58, 0x315e, 0x35cd, 0x4efc,
+    0xd21d, 0x5789, 0x75c8, 0x7f09, 0x0025, 0x3e47, 0x5131, 0x0054, 0x6ca9, 0x175f, 0x3a92, 0x4b32,
+    0x5c67, 0x64a4, 0x6e5d, 0x73e1, 0x7fc9, 0x0b31, 0x1889, 0x23d6, 0x2683, 0x2b16, 0xee90, 0x7d00,
+    0x2184, 0xa33f, 0xb2b2, 0x6213, 0x630b, 0x68d2, 0x06a2, 0x0945, 0x1c6f, 0x2553, 0x4ca4, 0x554b,
+    0x58c8, 0x5e44, 0x70e4, 0x8b11, 0x1aeb, 0x1c3e, 0x3e6f, 0xc79f, 0xd7a4, 0xdc19, 0x5fce, 0x14e7,
+    0x3934, 0x3b99, 0x4fee, 0x6b71, 0x118b, 0x38f8, 0x55d5, 0xeb33, 0x7f36, 0x8220, 0x4aa2, 0x5e4b,
+    0x247f, 0x34ad, 0x6aa7, 0x75c7, 0x176b, 0x22bb, 0x2835, 0x29cc, 0x34be, 0xb840, 0x3887, 0x3e56,
+    0x4f24, 0x6c2d, 0x9b3d, 0x2117, 0x43ca, 0x5b63, 0x69fb, 0x01cc, 0x1aba, 0x1ed1, 0x375c, 0x5eab,
+    0x6315, 0x6f06, 0x4e13, 0x7caf, 0x02cb, 0x04b1, 0x9326, 0x14bf, 0x217d, 0x26da, 0x3fcd, 0x4cae,
+    0x57b1, 0x7333, 0xf571, 0x7770, 0x781d, 0x788b, 0x7d48, 0x0013, 0x1867, 0x26c4, 0x7198, 0x7c5a,
+    0x1db9, 0xaf8f, 0x32b9, 0x5568, 0x7754, 0x5808, 0x5ca2, 0x75e3, 0x769c, 0x78c7, 0x00b4, 0x2a81,
+    0x3088, 0x3dbe, 0x4ae2, 0x77bb, 0x1d0f, 0x451b, 0x5ab5, 0x8536, 0x0ae0, 0x1a2f, 0x218d, 0x28f9,
+    0x2b21, 0x4622, 0x7339, 0x7561, 0x7622, 0x0f51, 0x1539, 0x1cd8, 0x3b9a, 0x3e51, 0x48ae, 0x53a7,
+    0x5ca1, 0x6916, 0x6c06, 0x6d28, 0x74d3, 0x7f25, 0x0000, 0x001b, 0x0036, 0x0a13, 0x103c, 0x9171,
+    0x44c5, 0xc63b, 0x5e86, 0x6380, 0x6818, 0x07cd, 0x365d, 0x5cb2, 0x85f9, 0x0db2, 0x1484, 0x2bfe,
+    0x5a01, 0x6639, 0x6a6b, 0x8001, 0x0ad9, 0x2d16, 0x3672, 0x49fc, 0x5d1d, 0xf66e, 0x0702, 0x91f0,
+    0x159d, 0x1dff, 0x2914, 0x32a9, 0x5011, 0x5c68, 0x5e6e, 0x64de, 0xf7b5, 0x2a4e, 0x2c59, 0x3549,
+    0x42bd, 0x5645, 0x6691, 0x6fb9, 0x7bc4, 0x261f, 0x2aa0, 0xe90e, 0x0028, 0x002f, 0x0952, 0x16d5,
+    0x4b1b, 0x1f2a, 0xa0aa, 0x64ee, 0x737d, 0x16d3, 0x5d0f, 0x67d0, 0x6b08, 0x7a6f, 0x13b6, 0x40b1,
+    0x575a, 0x0f67, 0x332d, 0xbee6, 0x46dc, 0x6439, 0x1a50, 0x345b, 0x3844, 0xd2ff, 0xd5cf, 0x6f98,
+    0x8224, 0x1b7d, 0x37ce, 0x4418, 0x679e, 0x7c1f, 0x0974, 0x31eb, 0x60ec, 0x735f, 0x75c2, 0x7e92,
+    0x0005, 0x0010, 0x001b, 0x0ffb, 0x34e7, 0x351e, 0x574f, 0x75f8, 0x136a, 0x1c06, 0x4d33, 0x4d8c,
+    0x54d5, 0x1a48, 0x59fd, 0x19f2, 0x2abe, 0x4979, 0xf7bd, 0xf8f8, 0x0fa9, 0x2417, 0x38e7, 0x50c6,
+    0x7f36, 0x8204, 0x194c, 0x3db5, 0xbe92, 0x5016, 0x5523, 0xece4, 0xf6aa, 0x2785, 0x458a, 0x7276,
+    0x0031, 0x3508, 0x4ee3, 0x421e, 0x438e, 0x448b, 0x6d43, 0x058e, 0x8f8c, 0x3565, 0x6d20, 0x7e21,
+    0x8935, 0x3165, 0xb845, 0x7272, 0x0c57, 0x91f5, 0x314b, 0x5ce5, 0x1c63, 0x22c2, 0x330d, 0x3ce6,
+    0x15e5, 0x21bb, 0x3070, 0x3d4c, 0xc0fc, 0x4b8b, 0x5c60, 0x1cb3, 0xa13b, 0x279c, 0x3247, 0x46d9,
+    0x4765, 0x4d01, 0x7c15, 0x4ad3, 0xd381, 0x10ce, 0x4d6d, 0x7dba, 0x19b3, 0x99b9, 0x5203, 0x776e,
+    0x7f56, 0x1337, 0x2f3c, 0x5221, 0x049a, 0x054a, 0x1dcb, 0x2a2b, 0x3753, 0xd543, 0x5a60, 0x5b33,
+    0x095f, 0x0cbb, 0x0ee0, 0x3bd6, 0x52c6, 0x73d2, 0x0a16, 0x130e, 0x582c, 0x0002, 0xe9c3, 0xe9e4,
+    0x7419, 0xf6cb, 0x9304, 0x2038, 0x5ef6, 0x6fb7, 0x9529, 0x1a97, 0x233c, 0xaa7b, 0x41a8, 0x508a,
+    0x6f28, 0xf549, 0x063c, 0x15ef, 0x6d98, 0x1a60, 0x619c, 0x5942, 0xfd7f, 0x96bf, 0x2c8c, 0x381c,
+    0x3a41, 0x4e6f, 0x58cd, 0x612c, 0x624f, 0x0000, 0x0011, 0x0022, 0x0033, 0x03df, 0xadd9, 0x39ca,
+    0xdadb, 0x09c2, 0x1b92, 0x43c8, 0x4994, 0x5d77, 0x2831, 0x44b7, 0xe4d7, 0x2a08, 0x464b, 0x47f0,
+    0x6621, 0xe865, 0x726b, 0x182f, 0x2659, 0x292e, 0x3c4e, 0x4d7e, 0xcdd3, 0xe10f, 0x04b5, 0x1d59,
+    0x3972, 0x47c6, 0x6277, 0x05f0, 0x13a9, 0xa189, 0x4014, 0x42a3, 0xcd3a, 0x591c, 0xdc81, 0x603c,
+    0xea35, 0x0026, 0x003c, 0x4c67, 0xde0d, 0x76d4, 0x0032, 0x285c, 0x6f0c, 0xefb7, 0x0c4c, 0x2b1b,
+    0x7373, 0xafff, 0x5cc8, 0x624f, 0x69cc, 0x7387, 0xc225, 0x4aee, 0xddec, 0x7fe8, 0x0d78, 0x131e,
+    0x9fa4, 0x260f, 0x243b, 0x7874, 0x3252, 0x6bc4, 0x6fa1, 0x0035, 0x188d, 0x2708, 0x331c, 0x477a,
+    0xfd68, 0x16a6, 0x2656, 0x2ef4, 0x651d, 0x4e1b, 0x4e6e, 0x62f4, 0xe7b4, 0x68fe, 0x0a13, 0x4855,
+    0x70b5, 0x890c, 0x1781, 0x7bda, 0x1099, 0x16ef, 0xd08e, 0x56d7, 0x3be0, 0xe71a, 0x7f60, 0x0659,
+    0x1b42, 0x45ac, 0x5c27, 0x000a, 0x002b, 0x004c, 0x0b22, 0x21aa, 0x401d, 0xc400, 0x624a, 0xe791,
+    0x7500, 0x063e, 0x372c, 0xc511, 0x756b, 0x07ae, 0x94de, 0x2c7f, 0x6daa, 0x5a67, 0x675f, 0x6faa,
+    0x714b, 0x8001, 0x14d5, 0x3813, 0xf08c, 0x092d, 0x12a9, 0x1754, 0x264c, 0x6ba9, 0x6f27, 0x8215,
+    0xaeac, 0x2f92, 0x4358, 0x6ba6, 0x06a1, 0x2622, 0x746c, 0x001c, 0x0043, 0xf980, 0x2d96, 0xe982,
+    0xee0e, 0x3745, 0x5945, 0x109c, 0x2bee, 0x3292, 0x3ab3, 0xa740, 0xaec0, 0x43ae, 0x520e, 0x563f,
+    0xffad, 0xa78e, 0x2e4c, 0x047c, 0x30ac, 0x34a6, 0x3d60, 0x41c6, 0x41f3, 0x74e6, 0x039e, 0x0e17,
+    0x9dd2, 0x225c, 0x3de2, 0x6d92, 0x94d6, 0x46f8, 0x6418, 0x712d, 0x736d, 0xffb7, 0xd39f, 0x5a20,
+    0x12dd, 0xa1d0, 0x3968, 0x52a3, 0xd8cf, 0xe847, 0x70d2, 0x15e7, 0x1e8c, 0x59b5, 0x7ef3, 0xa9ed,
+    0x3448, 0xd8fa, 0x73c4, 0xfc5c, 0x3847, 0x484c, 0x5fb5, 0x7175, 0x3466, 0x369e, 0xdd67, 0x071b,
+    0x1b7f, 0x9cc8, 0xa880, 0x5f00, 0x7849, 0x7c72, 0x003d, 0x0057, 0x1b5e, 0x613e, 0x1b94, 0x4784,
+    0x7c73, 0x0085, 0x8f6d, 0x23de, 0x25fa, 0x3d16, 0x1cdf, 0x29b3, 0xb602, 0x5829, 0x60ca, 0xea07,
+    0x7130, 0x7ac0, 0x0339, 0x4637, 0x8089, 0x7445, 0xf730, 0x81f8, 0xa5e9, 0x3e09, 0xf084, 0x02b0,
+    0x30d0, 0x33e2, 0xb943, 0x3c78, 0xf6fd, 0x0000, 0x004b, 0x1bb0, 0x9fbe, 0x2356, 0x2ae7, 0xcc12,
+    0xd3a0, 0x56f9, 0xdb29, 0xfe8d, 0x5479, 0x5e25, 0x7952, 0xfb91, 0x3d53, 0x68de, 0x164a, 0xa716,
+    0xbd3a, 0x4792, 0x5b09, 0x7c22, 0x1d59, 0x2ea6, 0xb116, 0xb3d5, 0x372a, 0x4d04, 0xde5a, 0x6b5e,
+    0x1dd6, 0x4623, 0xcf21, 0xd9c8, 0xfcc7, 0x7f04, 0x3e0d, 0x5038, 0x5e59, 0x6bc6, 0x8370, 0x92a7,
+    0xa301, 0xcc17, 0x5efb, 0xee2c, 0x7367, 0x0000, 0x000b, 0xf689, 0x372e, 0x3ebb, 0x4d8e, 0x665b,
+    0x66b4, 0x6c1d, 0x4a38, 0xd32a, 0xda02, 0x7563, 0xfc3a, 0x1115, 0x3fe7, 0x57e5, 0x3098, 0x4f89,
+    0x5145, 0x7373, 0x5378, 0x6fc7, 0x7bfa, 0x191d, 0x2ad4, 0x42ad, 0x42be, 0xd0a4, 0x5c00, 0x6353,
+    0x197f, 0xb70b, 0x391e, 0xbdf7, 0x4a12, 0x0000, 0x0011, 0x005b, 0x1052, 0x1715, 0xb88b, 0xdb90,
+    0xf4d3, 0x7d89, 0x0597, 0x453f, 0x6a94, 0xfcf2, 0x0351, 0xa4ab, 0xac11, 0x49ef, 0xfdaa, 0x7ec1,
+    0x2b7c, 0x4b91, 0x553b, 0xd602, 0x1a49, 0x38af, 0x6f8a, 0x85f0, 0x87d7, 0x2763, 0xa84e, 0x3f20,
+    0xcb1d, 0x547f, 0x1719, 0xb7ef, 0x3dd7, 0xf837, 0x22c0, 0x22e3, 0xbd1d, 0x3f86, 0x6267, 0x791e,
+    0x0013, 0x003c, 0x9176, 0x585e, 0x5f4c, 0x69cf, 0xbf45, 0xd9e7, 0xf752, 0x78b7, 0x7a19, 0x7d6a,
+    0x1d60, 0x3e8c, 0x45d9, 0x51a0, 0xd541, 0xf100, 0x7560, 0x05c4, 0xbdab, 0xbe2e, 0x3f31, 0x722a,
+    0x0b4e, 0x149b, 0xa8e8, 0x3311, 0x8489, 0x2410, 0x26f1, 0x2a44, 0xbbef, 0xbbfb, 0xc3b6, 0x6f53,
+    0xfb9b, 0x01fa, 0x19d7, 0x99e9, 0x2164, 0x3623, 0x376e, 0x7ae3, 0x7e32, 0x7fcc, 0x41ba, 0xd0ad,
+    0x70b5, 0x80a5, 0x879e, 0x26a8, 0x29fe, 0x5c7f, 0x7197, 0x784f, 0x8b75, 0x1e36, 0x5108, 0xd4d6,
+    0x39b5, 0xd823, 0x6cd1, 0x3abb, 0x6449, 0x9260, 0x359c, 0x66f6, 0x6950, 0x0918, 0x3a16, 0x7d60,
+    0xab42, 0x8cb8, 0xbbcb, 0xe3dc, 0x6ebe, 0x7b91, 0x38d3, 0x5a8c, 0x6321, 0x77dc, 0x2fe1, 0xe107,
+    0x722e, 0x8cce, 0x12d5, 0x2405, 0x5329, 0xd798, 0xe011, 0x745e, 0xf51f, 0x7788, 0x07e0, 0x0cf2,
+    0x1a4e, 0x2434, 0xc071, 0x421d, 0xe49f, 0x703d, 0x0749, 0x153c, 0x2088, 0x25ac, 0xaf4c, 0x506a,
+    0x569b, 0xeb4a, 0x6c29, 0x002f, 0x87a4, 0x095f, 0xaf74, 0x334e, 0xcce1, 0xe5ef, 0x7979, 0x1b5b,
+    0x33b0, 0xc43d, 0x7ed5, 0x9650, 0x9b14, 0x2944, 0xab56, 0x6ff8, 0x006a, 0x1bea, 0xa75b, 0xccc3,
+    0x3abd, 0x4404, 0xee32, 0x72f1, 0x6143, 0x7faf, 0x12d2, 0x982a, 0xcfc3, 0x65c0, 0x6f49, 0x0036,
+    0x0588, 0x3bd4, 0x6db0, 0x260f, 0xc8ec, 0x5186, 0xf26b, 0x7d37, 0x13fb, 0x3e8d, 0xd604, 0xf754,
+    0x7a45, 0x044d, 0xa48d, 0xc9cd, 0x2377, 0xb7d7, 0xf82c, 0x7d3f, 0x861b, 0x130a, 0x16bf, 0x9846,
+    0x2e5b, 0xbffb, 0xdb5b, 0x6a98, 0x230c, 0xa80a, 0xb327, 0xb653, 0xbb26, 0xbbe2, 0x3ec1, 0x55d6,
+    0x7030, 0x0005, 0x004f, 0x87fe, 0x10f7, 0x4544, 0x6346, 0x6362, 0x0342, 0x4484, 0x5833, 0xbe27,
+    0x4db6, 0x14e6, 0x609e, 0x15b7, 0x233c, 0x21b4, 0xb7d7, 0xba11, 0xd540, 0xda15, 0x5b77, 0xe90a,
+    0x8bf8, 0xbb7f, 0x5e0e, 0x7f9b, 0x001f, 0x0064, 0x1c4e, 0x1d77, 0x5d07, 0xbbf4, 0x7149, 0x879a,
+    0x0af4, 0x175c, 0xcd16, 0x5b75, 0x5e65, 0x868c, 0xaa11, 0x3fd5, 0xba52, 0x40a7, 0xcc28, 0x0270,
+    0x9ad8, 0x61a7, 0x1454, 0x2f26, 0x7ef2, 0x8186, 0xb40b, 0xf892, 0x0036, 0x003d, 0x3d5c, 0x40af,
+    0x4311, 0x67fd, 0x68d2, 0x6c6d, 0xed62, 0x0aab, 0x33e8, 0x34e1, 0x73ce, 0xf661, 0x1939, 0x9e39,
+    0x2760, 0x2f83, 0xe6d4, 0xe706, 0xe79c, 0xf323, 0x3a66, 0x5e4b, 0x60a0, 0xf978, 0xa776, 0x333c,
+    0x3b1d, 0xbda9, 0x517e, 0x7489, 0x5c9a, 0xfbbc, 0x25d8, 0x450c, 0x5c4f, 0x0009, 0xac4c, 0xd158,
+    0x697f, 0x9167, 0xa02e, 0x00f6, 0x7b75, 0xad34, 0x3318, 0x2637, 0xb8b8, 0xcd76, 0xd59b, 0x12b6,
+    0xb039, 0xee24, 0x0cc6, 0x8dee, 0xb68a, 0x3eb7, 0x4a69, 0x5935, 0x86ce, 0x1786, 0x2668, 0xa8af,
+    0xcdaf, 0xe857, 0x7287, 0x001a, 0x005d, 0x0c51, 0x1961, 0xcda0, 0x6220, 0x7620, 0x7832, 0x3fad,
+    0x6db6, 0x7de3, 0x848b, 0x899b, 0x43cf, 0xe6a7, 0xed57, 0x8639, 0x3b13, 0x4ee3, 0x633d, 0x07ac,
+    0xbfee, 0x50ee, 0x55ea, 0x6668, 0x5cc9, 0x010d, 0x17c6, 0x265b, 0x3042, 0x513e, 0x66f8, 0x7034,
+    0x7522, 0x7d4d, 0x74f9, 0x003c, 0x9f66, 0xa49e, 0xa7b8, 0x30a7, 0xd073, 0x5449, 0x5ad3, 0x6dbb,
+    0x8274, 0x0ec1, 0xa2ce, 0x32ad, 0x6083, 0xe367, 0x73de, 0x02ea, 0x100c, 0x925f, 0x24af, 0x487e,
+    0x692d, 0x14d8, 0xa476, 0xf63f, 0x0553, 0x11b3, 0x9867, 0x9f46, 0x21cd, 0x6364, 0x6aca, 0x782a,
+    0x011d, 0xa2ca, 0xa803, 0x5482, 0x1d60, 0xbaf0, 0xbb8c, 0x43da, 0xcfa2, 0x0054, 0x1220, 0x2781,
+    0x2bef, 0x33aa, 0xbbc7, 0x5bc6, 0x6101, 0x8802, 0xe1a0, 0x8958, 0x90ee, 0x9b50, 0xa687, 0xaf90,
+    0xbeb0, 0xe0b5, 0x60f0, 0x7bd7, 0x1538, 0x3163, 0x46a2, 0xcbb5, 0xd555, 0xd5f3, 0x95ae, 0xaa1c,
+    0x315c, 0x4af0, 0xe970, 0x0174, 0x1aa5, 0x1aad, 0x2839, 0x425e, 0x47bc, 0xf9eb, 0xffd2, 0xa380,
+    0x282e, 0x3f6a, 0xd2f9, 0xd7f4, 0x6a17, 0x2020, 0xb631, 0xdad5, 0x7add, 0xfb31, 0x7d29, 0xfe59,
+};
+
+inline uint32_t amdgpu_rsq_normalized_bits(uint32_t index) {
+  uint32_t result = amdgpu_rsq_polynomial(index);
+  const uint32_t bucket = index >> 15;
+  const uint16_t key = index & 0x7fffu;
+  uint32_t first = kAmdgpuRsqCorrectionOffsets[bucket];
+  uint32_t last = kAmdgpuRsqCorrectionOffsets[bucket + 1];
+  const uint32_t end = last;
+  while (first < last) {
+    const uint32_t middle = first + (last - first) / 2;
+    if ((kAmdgpuRsqCorrections[middle] & 0x7fffu) < key)
+      first = middle + 1;
+    else
+      last = middle;
+  }
+  if (first != end && (kAmdgpuRsqCorrections[first] & 0x7fffu) == key)
+    result = (kAmdgpuRsqCorrections[first] & 0x8000u) ? result + 1 : result - 1;
+  return result;
+}
+
+inline uint32_t amdgpu_rsq_bits(uint32_t input, bool quiet_snan = true) {
+  const uint32_t magnitude = input & 0x7fffffffu;
+  const uint32_t sign = input & 0x80000000u;
+  if (magnitude > 0x7f800000u)
+    return input | (quiet_snan ? 0x00400000u : 0u);
+  if (magnitude < 0x00800000u)
+    return sign | 0x7f800000u;
+  if (sign != 0)
+    return 0xffc00000u;
+  if (magnitude == 0x7f800000u)
+    return 0;
+
+  const int exponent = static_cast<int>(magnitude >> 23) - 127;
+  const unsigned parity = exponent & 1;
+  const uint32_t normalized =
+      amdgpu_rsq_normalized_bits((parity << 23) | (magnitude & 0x007fffffu));
+  const int result_exponent =
+      static_cast<int>(normalized >> 23) - (exponent - static_cast<int>(parity)) / 2;
+  return (static_cast<uint32_t>(result_exponent) << 23) | (normalized & 0x007fffffu);
+}
+} // namespace util::detail
+
+namespace util {
+
+/// @brief AMD single-precision reciprocal square root matching captured RDNA3/4 outputs.
+/// @details The empirical mapping satisfies the shared ISA one-ULP bound and flushes input
+/// subnormals independently of MODE. Positive normal inputs produce normal outputs. NaN
+/// payloads retain their sign, with caller-selected quieting; negative normal inputs and negative
+/// infinity produce 0xffc00000. Signed zero and flushed subnormals produce signed infinity;
+/// positive infinity produces positive zero. Results are independent of host rounding.
+inline float amdgpu_rsq_f32(float value, bool quiet_snan = true) {
+  return std::bit_cast<float>(detail::amdgpu_rsq_bits(std::bit_cast<uint32_t>(value), quiet_snan));
+}
+
+/// @brief Evaluate reciprocal square root of an exactly promoted F16 source.
+/// @details Denormal mode bit 0 preserves F16 input subnormals; otherwise they become
+/// signed zero: promotion alone makes F16 subnormals appear normal in F32. The returned
+/// F32 approximation is unrounded to F16; callers must narrow it with nearest-even
+/// rounding after output modifiers. That result matches RDNA3/4 and satisfies the stricter

Can we simplify this by removing amdgpu_rsq_f16, amdgpu_sqrt_f16, and their two SIMD adapters? A repository-wide search finds only the definitions and adapter calls; instruction execution already uses transcendental::map_f16 / map_f16_simd for half rounding, denormal handling, overflow, and NaN policy.

The unused helpers expose unrounded F32 results (and RSQ has no selectable NaN quieting). Their documentation here and in amdgpu_sqrt.h:187-188 also says to narrow after output modifiers, whereas the execution path rounds and handles half output denormals before OMOD. If these helpers need to remain, we should correct that contract to require the half rounding/denormal/overflow stages before OMOD. This is an API maintenance concern; current instruction callers use the shared policy path.

sjain-stanford sjain-stanford commented on Sep 30, 2026 01:13 UTC
Reviewer

One small suggestion

arsenm arsenm commented on Sep 30, 2026 10:23 UTC
Reviewer

I'm quite interested in getting hardware exact constant folding of all intrinsics in the compiler. Is it possible to put this into a library somewhere?

kuhar kuhar commented on Sep 30, 2026 13:31 UTC
Author

I'm quite interested in getting hardware exact constant folding of all intrinsics in the compiler. Is it possible to put this into a library somewhere?

That's the plan down the road, but until then, you can extract it if you want, the license is quite permissive.

sjain-stanford sjain-stanford approved these changes on Sep 30, 2026 18:36 UTC
Approved Reviewer

LGTM

systems-assistant[bot] systems-assistant[bot] commented on Oct 05, 2026 04:22 UTC
Bot

<!-- therock-bump-breadcrumb -->

TheRock Submodule Bump Activity


_Newest first_

  • 2026-10-05 — Included in TheRock via ROCm/TheRock#8732. <!-- event-id: 113829fa31e5adb52744f77f20a766bfc9698f41_rocm-systems_False --> <!-- event-time: 2026-10-05T04:16:52+00:00 -->
  • Assignees
    kuhar kuhar
    Labels
    risk: low confidence: 70.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 71.5% (HIGH) · Higher = larger blast radius
    71.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 70.2% · Lower = rushed or shallow review
    70.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.3% · Safe to merge
    21.3%