research: preserve solver experiments and reproducible benchmarks
This commit is contained in:
parent
12e4266950
commit
e93bc20b0a
85 changed files with 518443 additions and 0 deletions
135
research/experiments/full_search_feasibility/REPORT.md
Normal file
135
research/experiments/full_search_feasibility/REPORT.md
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
# 实验结论:定点求解显著提速,全世界目录仍不适合启动
|
||||
|
||||
日期:2026-10-11,Asia/Hong_Kong。硬件:RTX 3060 Laptop、Ryzen 7 5800H,WSL,CUDA 12.0。
|
||||
|
||||
## 结论
|
||||
|
||||
1. **保留输出差过滤+逐格区间求交。** GPU 搜索 kernel 在三组同任务对照中快 197~292 倍,完整输出一致。
|
||||
2. **保留低位坐标类复用。** 52,213 个实际位置的完整低位根列表与 32 个代表类一致;它减少根生成,不能消除后续中间位枚举。
|
||||
3. **否决低位位表查找替换。** 此 GPU 上查表比直接整数计算多耗时约 36%。
|
||||
4. **保留按首个奇数格逆推拒绝尾部。** 相比逐格枚举全部尾部,128 坐标批次快约 24 倍,并覆盖多次拒绝和多个格子首次拒绝的情况。
|
||||
5. **当前路线仍不足以生成全世界全部种子的目录。** 随机批次吞吐外推:首次输出分支约 0.9 年;包含拒绝重抽的完整分支约 16 年。这里已乐观地摊薄进程启动、复用低位根生成,不是实际跑完全世界,也不是所有可能算法的下界。
|
||||
|
||||
代码是独立实验,没有替换原来的正式入口。
|
||||
|
||||
## GPU 求解器对照
|
||||
|
||||
全部模式处理相同的 lower35 候选,完整预热后轮换顺序测量五轮,核对排序后的完整 `(world_seed,x,z)` 列表。
|
||||
|
||||
| 负载 | lower35 数 | 原排序事件求解器 | 仅区间求交 | 输出差+原求解器 | 输出差+区间求交 | 最佳相对原版 |
|
||||
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
||||
| 已知位置 `(51069,419124)` | 11,010,048 | 63.750 ms | 0.763 ms | 0.390 ms | **0.324 ms** | **197.0×** |
|
||||
| 21 个压力/边界坐标 | 62,128,128 | 363.876 ms | 4.674 ms | 1.757 ms | **1.245 ms** | **292.2×** |
|
||||
| 4096 个均匀随机坐标 | 387,973,120 | 2318.625 ms | 29.380 ms | 12.297 ms | **8.157 ms** | **284.2×** |
|
||||
| 65536 个均匀随机坐标 | 5,944,901,632 | 未重测 | 407.659 ms | 175.974 ms | **131.670 ms** | — |
|
||||
|
||||
以上均为 CUDA event kernel 中位数,不包括低位根生成、CUDA 初始化、分配和传输。21 坐标组包含已知命中附近位置、原点、世界边界和 int32 边界;它不代表随机平均坐标。
|
||||
|
||||
已知位置和压力组均得到相同的 24 个种子。两个随机组没有命中。随机无命中不单独构成正确性证据,另有下面的独立校验。
|
||||
|
||||
主要收益来自更早排除不可能共同满足模 10 条件的候选:
|
||||
|
||||
```
|
||||
delta_i = (q_i(0) - q_0(0)) mod 2^31
|
||||
必要条件:delta_i mod 10 属于 {0,8}
|
||||
```
|
||||
|
||||
原因是改变高 13 位,对所有输出施加相同的模 `2^31` 平移;两个最终输出都是 10 的倍数时,差模 `2^31` 只能具有上述余数。多数候选在几个格子后就失败,不再支付 25 格的事件排序成本。差过滤通过后,最多两个“区间+余数”做逐格求交,再完整 Java 验证。
|
||||
|
||||
## 根分布与全局工作量
|
||||
|
||||
确定性均匀随机抽样 65536 个锚点,两轴范围 `[-1875000,1874999]`:
|
||||
|
||||
| 指标 | 结果 |
|
||||
| --- | ---: |
|
||||
| 首次输出低位无根比例 | 96.9162% |
|
||||
| 低 18 位根总数 | 45,356 |
|
||||
| 每坐标平均根数 | 0.69208 |
|
||||
| 平均数的正态近似 95% 区间 | 0.61054~0.77361 |
|
||||
| 最大根数 | 1015 |
|
||||
|
||||
分布有较长尾部。置信区间只说明该抽样模型中的根数均值不确定性,不包含 GPU 频率、长期运行、分组调度及模型覆盖的误差。
|
||||
|
||||
按样本均值,世界的 `14,062,500,000,000` 个锚点仍约有:
|
||||
|
||||
```
|
||||
14,062,500,000,000 × 0.69207763671875 × 131072
|
||||
= 1.2756375 × 10^18 个 lower35 候选
|
||||
```
|
||||
|
||||
新 kernel 在 65536 坐标批次中约处理 451.5 亿个 lower35/秒。把实测批次吞吐线性扩展到全部锚点,首次输出分支约 **0.895 年**。这已不适合用早先的“已知命中坐标耗时 × 所有坐标”去估计成几万年,但距离几周完成仍有明显差距。
|
||||
|
||||
## 坐标类复用和位表查找
|
||||
|
||||
归一化有效种子 `s=world_seed+T(x,z)` 后,图案相对坐标项的低 18 位在 X 上以 `65536`、Z 上以 `131072` 为周期。
|
||||
|
||||
选取 32 个有根的类,并展开成世界内全部 52,213 个实际锚点。程序逐一比较每个同类位置的**完整归一化低位根列表**,全部一致。
|
||||
|
||||
| 低位筛选负载 | 直接整数计算 | 32 KiB 位表查找 |
|
||||
| --- | ---: | ---: |
|
||||
| 65536 随机坐标 | **280.639 ms** | 380.533 ms |
|
||||
| 32 个类代表 | **0.138 ms** | 0.209 ms |
|
||||
| 52,213 个实际位置重复计算 | **293.866 ms** | 409.952 ms |
|
||||
|
||||
因此查表方案不保留。类复用在算法上成立,表中只比较筛选 kernel,未把归类、展开和传输成本当作零成本的实测完整方案。全世界最多 `2^33` 个类,按大批次根筛选吞吐粗略外推,代表类筛选约 10.2 小时;更高位求解仍须处理具体坐标,不能再乘一个“1637 倍”全流程加速。
|
||||
|
||||
首次输出无根并不排除拒绝重抽解,所以不能据此跳过完整语义的异常分支。
|
||||
|
||||
## 完整覆盖拒绝重抽
|
||||
|
||||
朴素补扫对 25 格分别枚举 `8 × 2^17` 个首次拒绝状态,共 26,214,400 个候选/坐标。
|
||||
|
||||
本轮新增的规范化补扫只枚举一次有效种子的低 18 位 `p`:
|
||||
|
||||
1. 从 p 算出每格首次输出的奇偶。
|
||||
2. 若存在奇数格,选第一个。任何真实解必须在这一格首次拒绝,否则不可能返回 0。
|
||||
3. 该格状态的低 18 位已确定,在拒绝区间中恰好有四个完整推进后状态与它一致;逆推这四个完整种子,执行全部格子的精确 Java 检查。
|
||||
4. 若全部格子都是偶数,则为每一格补扫四个拒绝状态。
|
||||
|
||||
若一个坐标有 R 个全偶低位根,最多生成 `2^20 + 96R` 个补扫候选。无需假设“多个格子同时拒绝不可能”;选择首个奇数格的必要性对这种情况也成立。所有首次输出都被接受的真实解由普通分支覆盖,任何首次拒绝的真实解由补扫覆盖。最终并集去重。
|
||||
|
||||
| 对照任务 | 逐格朴素补扫 | 规范化补扫 | 去重命中数 |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| 已知坐标的单格约束 | 0.032 ms | 0.026 ms | 104,848 |
|
||||
| 同坐标前两格约束 | 0.065 ms | 0.053 ms | 20,888 |
|
||||
| 同坐标前五格约束 | 0.139 ms | 0.084 ms | 109 |
|
||||
| 128 坐标的完整 5×5 | 93.597 ms | **3.908 ms** | 0 |
|
||||
|
||||
两种补扫逐项比较完整去重列表,单格、多格的非空结果也一致。
|
||||
|
||||
## 同批完整流程:最终成本判断
|
||||
|
||||
在同一个 65536 随机坐标批次中,普通分支和规范化拒绝补扫顺序执行,合并、排序、去重;完整预热后测五轮:
|
||||
|
||||
| 区域 | 中位数 |
|
||||
| --- | ---: |
|
||||
| 一次低位根准备 kernel | 296.573 ms(单次) |
|
||||
| 普通搜索 kernel | 129.157 ms |
|
||||
| 完整拒绝补扫 kernel | 2283.082 ms |
|
||||
| 两个 kernel 的每轮耗时之和 | **2413.373 ms** |
|
||||
| 同步、回传、合并在内的 host scan | **2356.676 ms** |
|
||||
|
||||
另在 21 坐标压力组完成同样的完整流程,全部 24 个已知结果保留,无额外拒绝解;完整结果已与此前普通分支核对。
|
||||
|
||||
本环境观察到 CUDA event 累计时间比 host wall time 高约 2.4%;两种时钟口径分别保留,不用它们混合计算局部加速比。这一差异的原因未单独确定,长期外推只按数量级解释。
|
||||
|
||||
按同批完整测量,外推全世界为 **16.0~16.4 年**。这里不重复支付进程启动,低位筛选可按坐标类摊薄;尚未计入全世界调度、建表、长期频率波动和输出持久化等工程成本。不能宣称已实现完整世界扫描。
|
||||
|
||||
补扫约占计算时间的 95%。**即使完全删掉这个正确性成本,普通分支仍约需一年。** 因此结论不依赖于罕见分支是否必须支持:这轮优化值得用于定点反查和有限批次,但仍不应启动全世界目录生成。
|
||||
|
||||
## 正确性检查与复现
|
||||
|
||||
- CPU 独立直接枚举 4096 个高位平面,共 33,554,432 个完整种子,覆盖 1~25 格约束、随机坐标和已知命中平面。原求解器、区间求解器和输出差过滤版本的完整列表一致。
|
||||
- 用单独的 Java 算术实现核对全部 1,048,576 个单格拒绝状态及逆推;其中存在 52,422 个首次输出为奇数、重抽后成功的例子,防止测试只覆盖空结果。
|
||||
- CPU 核对 250,000 个格子的坐标周期;GPU 每批抽取最多 64 个坐标完整核对低位根表,并对所有重复坐标类比较完整根列表。
|
||||
- GPU 四种求解器、两种根筛选、两种拒绝补扫分别完整核对结果,容量溢出会失败。
|
||||
- GPU 与桌面共享,五轮原始数据、温度、驱动、源码哈希及每项命令保存在结果文件。早期对照和后补完整流程的源码哈希分别记录,计算 kernel 的算法一致。
|
||||
|
||||
```
|
||||
python3 research/experiments/full_search_feasibility/run.py
|
||||
# GPU 需可访问;无 GPU 时可单独编译运行 cpu_verify.cpp。
|
||||
python3 research/experiments/full_search_feasibility/run.py --analyse-only
|
||||
```
|
||||
|
||||
核心代码:[interval_solver.hpp](interval_solver.hpp)、[cuda_bench.cu](cuda_bench.cu)。
|
||||
汇总:[results/summary.json](results/summary.json)。完整实验数据:[results/all.json](results/all.json)。
|
||||
73
research/experiments/full_search_feasibility/cpu_verify.cpp
Normal file
73
research/experiments/full_search_feasibility/cpu_verify.cpp
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
#include "interval_solver.hpp"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
namespace sr=slime_research;
|
||||
namespace fs=full_search_experiment;
|
||||
struct Emit {std::vector<uint64_t>& result;void operator()(uint64_t s){result.push_back(s);}};
|
||||
void require(bool b,const char*message){if(!b)throw std::runtime_error(message);}
|
||||
|
||||
// Separate Java arithmetic oracle. Every conversion is explicit to avoid signed overflow.
|
||||
uint64_t term(int32_t x,int32_t z){
|
||||
auto sx=[](uint32_t n){return uint64_t(int64_t(int32_t(n)));};
|
||||
uint32_t a=uint32_t(x),b=uint32_t(z);
|
||||
return sx(a*a*4987142U)+sx(a*5947611U)+sx(b*b)*4392871ULL+sx(b*389711U);
|
||||
}
|
||||
bool exact(uint64_t seed,uint64_t coordinate){
|
||||
uint64_t s=((seed+coordinate)^987234911ULL^0x5DEECE66DULL)&((1ULL<<48)-1);
|
||||
for(;;){s=(s*0x5DEECE66DULL+11)&((1ULL<<48)-1);uint32_t q=s>>17;
|
||||
if(q<2147483640U)return q%10==0;}
|
||||
}
|
||||
int main(){
|
||||
std::mt19937_64 rng(2026101102);
|
||||
uint64_t checked=0;
|
||||
for(int test=0;test<4096;++test){
|
||||
int32_t x=int32_t(rng()%3750000)-1875000,z=int32_t(rng()%3750000)-1875000;
|
||||
if(test<24){x=51069;z=419124;}
|
||||
std::array<sr::CellTerm,25> cells;
|
||||
for(int j=0;j<5;j++)for(int i=0;i<5;i++)cells[j*5+i]={term(x+i,z+j),sr::kSlime};
|
||||
int count=test<24?25:1+test%25;
|
||||
uint64_t low=rng()&((1ULL<<35)-1);
|
||||
if(test<24)low=(test%2?15959335054446ULL:61692151016558ULL)&((1ULL<<35)-1);
|
||||
std::vector<uint64_t> direct,old,interval,filtered;Emit a{old},b{interval},c{filtered};
|
||||
sr::solveUpper13(low,cells.data(),count,a);fs::solveIntervals(low,cells.data(),count,b);
|
||||
if(fs::differenceFilter(low,cells.data(),count))fs::solveIntervals(low,cells.data(),count,c);
|
||||
for(uint64_t h=0;h<8192;++h){
|
||||
uint64_t s=low+(h<<35);bool ok=true;
|
||||
for(int i=0;i<count;++i){
|
||||
uint64_t v=(((s+cells[i].term)^0x5E434E432ULL)*0x5DEECE66DULL+11)&((1ULL<<48)-1);
|
||||
if((v>>17)%10!=0||!exact(s,cells[i].term)){ok=false;break;}
|
||||
}
|
||||
if(ok)direct.push_back(s);
|
||||
}
|
||||
std::sort(old.begin(),old.end());std::sort(interval.begin(),interval.end());std::sort(filtered.begin(),filtered.end());
|
||||
require(old==direct&&interval==direct&&filtered==direct,"upper enumeration mismatch");checked+=8192;
|
||||
}
|
||||
uint64_t rejectedSlime=0,oddRejectedSlime=0;
|
||||
for(uint64_t v=uint64_t(2147483640U)<<17;v<(1ULL<<48);++v){
|
||||
const uint64_t t=term(-1875000,1874999);
|
||||
const uint64_t u=((v-11)*0xDFE05BCB1365ULL)&((1ULL<<48)-1);
|
||||
const uint64_t seed=((u^0x5E434E432ULL)-t)&((1ULL<<48)-1);
|
||||
const uint64_t recovered=(((seed+t)^0x5E434E432ULL)*0x5DEECE66DULL+11)&((1ULL<<48)-1);
|
||||
require(v==recovered,"tail inversion mismatch");
|
||||
bool a=exact(seed,t),b=sr::exactIsSlimeFromTerm(seed,t);require(a==b,"Java oracle mismatch");
|
||||
rejectedSlime+=a;oddRejectedSlime+=a&&((v>>17)&1);
|
||||
}
|
||||
require(oddRejectedSlime>0,"missing rejection regression example");
|
||||
for(int n=0;n<10000;++n){
|
||||
int32_t x=int32_t(rng()%3750000)-1875000,z=int32_t(rng()%3750000)-1875000;
|
||||
for(int j=0;j<5;++j)for(int i=0;i<5;++i){
|
||||
uint64_t d=(term(x+i,z+j)-term(x,z))&((1U<<18)-1);
|
||||
require(d==((term(x+65536+i,z+j)-term(x+65536,z))&((1U<<18)-1)),"X periodicity mismatch");
|
||||
require(d==((term(x+i,z+131072+j)-term(x,z+131072))&((1U<<18)-1)),"Z periodicity mismatch");
|
||||
}
|
||||
}
|
||||
std::cout<<"{\"upper_planes\":4096,\"direct_seeds\":"<<checked
|
||||
<<",\"tail_states\":1048576,\"tail_slime\":"<<rejectedSlime
|
||||
<<",\"odd_tail_slime\":"<<oddRejectedSlime
|
||||
<<",\"periodicity_cells\":250000,\"passed\":true}\n";
|
||||
}
|
||||
256
research/experiments/full_search_feasibility/cuda_bench.cu
Normal file
256
research/experiments/full_search_feasibility/cuda_bench.cu
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
#include "interval_solver.hpp"
|
||||
#include <cuda_runtime.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <numeric>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
namespace sr = slime_research;
|
||||
namespace fs = full_search_experiment;
|
||||
using Clock = std::chrono::steady_clock;
|
||||
#define CUDA(call) do { auto e = (call); if (e != cudaSuccess) throw std::runtime_error(std::string(#call)+": "+cudaGetErrorString(e)); } while (0)
|
||||
struct Position { int32_t x, z; uint64_t anchor; sr::CellTerm cells[25]; };
|
||||
struct Job { uint32_t position, root; };
|
||||
struct Match { uint64_t position, seed; bool operator<(const Match& o)const{return std::tie(position,seed)<std::tie(o.position,o.seed);} bool operator==(const Match& o)const{return position==o.position&&seed==o.seed;} };
|
||||
constexpr uint32_t MATCH_CAPACITY = 1U << 20;
|
||||
constexpr uint32_t JOB_CAPACITY = 1U << 22;
|
||||
|
||||
Position makePosition(int32_t x,int32_t z) {
|
||||
Position p{}; p.x=x;p.z=z;p.anchor=sr::coordinateTerm(x,z);
|
||||
for(int j=0;j<5;++j)for(int i=0;i<5;++i)
|
||||
p.cells[j*5+i]={(sr::coordinateTerm(x+i,z+j)-p.anchor)&sr::kMask48,sr::kSlime};
|
||||
return p;
|
||||
}
|
||||
|
||||
template<int Mode>
|
||||
__global__ void rootKernel(const Position* positions,uint32_t count,const uint32_t* good,
|
||||
uint32_t* counts,Job* jobs,unsigned long long* total,bool collect) {
|
||||
uint64_t idx=uint64_t(blockIdx.x)*blockDim.x+threadIdx.x;
|
||||
if(idx >= (uint64_t(count)<<18)) return;
|
||||
const uint32_t pos=uint32_t(idx>>18), root=uint32_t(idx)&((1U<<18)-1);
|
||||
const Position& p=positions[pos];
|
||||
for(int i=0;i<25;++i){
|
||||
const uint32_t in=root+uint32_t(p.cells[i].term);
|
||||
if constexpr(Mode==0){
|
||||
if((((in^uint32_t(sr::kCombinedXor))*uint32_t(sr::kJavaMultiplier)+11U)>>17)&1U)return;
|
||||
}else{
|
||||
const uint32_t k=in&((1U<<18)-1);
|
||||
if(((good[k>>5]>>(k&31))&1U)==0)return;
|
||||
}
|
||||
}
|
||||
atomicAdd(counts+pos,1U);
|
||||
const auto at=atomicAdd(total,1ULL);
|
||||
if(collect&&at<JOB_CAPACITY)jobs[at]={pos,root};
|
||||
}
|
||||
|
||||
struct Emitter {
|
||||
uint32_t position; uint64_t anchor; Match* out; unsigned long long* count;
|
||||
__device__ void operator()(uint64_t s){
|
||||
auto at=atomicAdd(count,1ULL);
|
||||
if(at<MATCH_CAPACITY)out[at]={position,(s-anchor)&sr::kMask48};
|
||||
}
|
||||
};
|
||||
template<int Mode>
|
||||
__global__ void searchKernel(const Position* positions,const Job* jobs,uint32_t count,
|
||||
Match* out,unsigned long long* total) {
|
||||
uint64_t idx=uint64_t(blockIdx.x)*blockDim.x+threadIdx.x;
|
||||
if(idx >= (uint64_t(count)<<17))return;
|
||||
const Job job=jobs[idx>>17];
|
||||
uint64_t low=job.root+((idx&((1U<<17)-1))<<18);
|
||||
const Position& p=positions[job.position];
|
||||
Emitter emit{job.position,p.anchor,out,total};
|
||||
if constexpr(Mode==0)sr::solveUpper13(low,p.cells,25,emit);
|
||||
else if constexpr(Mode==1)fs::solveIntervals(low,p.cells,25,emit);
|
||||
else if constexpr(Mode==2){if(fs::differenceFilter(low,p.cells,25))sr::solveUpper13(low,p.cells,25,emit);}
|
||||
else if constexpr(Mode==3){if(fs::differenceFilter(low,p.cells,25))fs::solveIntervals(low,p.cells,25,emit);}
|
||||
}
|
||||
__global__ void tailKernel(const Position* positions,uint32_t count,Match* out,unsigned long long* total,int cellCount){
|
||||
const uint64_t idx=uint64_t(blockIdx.x)*blockDim.x+threadIdx.x;
|
||||
if(idx >= uint64_t(count)*cellCount*(1U<<20))return;
|
||||
const uint64_t cell=idx>>20;
|
||||
const uint32_t pos=cell/cellCount,i=cell%cellCount;
|
||||
const uint64_t v=(uint64_t(2147483640U)<<17)+(idx&((1U<<20)-1));
|
||||
const Position& p=positions[pos];
|
||||
const uint64_t u=((v-11)*0xDFE05BCB1365ULL)&sr::kMask48;
|
||||
const uint64_t seed=((u^sr::kCombinedXor)-p.cells[i].term)&sr::kMask48;
|
||||
if(sr::verifyPattern(seed,p.cells,cellCount)){
|
||||
Emitter e{pos,p.anchor,out,total};e(seed);
|
||||
}
|
||||
}
|
||||
|
||||
// If an output is odd, a true solid-pattern seed must reject that output.
|
||||
// Pick the first odd cell: four tail states correspond to each seed-low18.
|
||||
// When every output is even, enumerate all cells' four tail states instead.
|
||||
// This covers multiple-rejection paths too, without assuming they are impossible.
|
||||
__global__ void canonicalTailKernel(const Position* positions,uint32_t count,Match* out,unsigned long long* total,int cellCount){
|
||||
const uint64_t idx=uint64_t(blockIdx.x)*blockDim.x+threadIdx.x;
|
||||
if(idx >= (uint64_t(count)<<18))return;
|
||||
const uint32_t pos=idx>>18,root=idx&((1U<<18)-1);
|
||||
const Position& p=positions[pos];
|
||||
int firstOdd=-1;
|
||||
for(int i=0;i<cellCount;++i)if((sr::nextStateFromTerm(root,p.cells[i].term)>>17)&1U){firstOdd=i;break;}
|
||||
const int begin=firstOdd>=0?firstOdd:0,end=firstOdd>=0?firstOdd+1:cellCount;
|
||||
for(int i=begin;i<end;++i){
|
||||
const uint32_t vlow=uint32_t(sr::nextStateFromTerm(root,p.cells[i].term))&((1U<<18)-1);
|
||||
for(uint32_t k=0;k<4;++k){
|
||||
const uint64_t v=(uint64_t(2147483640U+(vlow>>17)+2*k)<<17)+(vlow&((1U<<17)-1));
|
||||
const uint64_t u=((v-11)*0xDFE05BCB1365ULL)&sr::kMask48;
|
||||
const uint64_t seed=((u^sr::kCombinedXor)-p.cells[i].term)&sr::kMask48;
|
||||
if(sr::verifyPattern(seed,p.cells,cellCount)){Emitter e{pos,p.anchor,out,total};e(seed);}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Device {
|
||||
Position* positions=nullptr; Job* jobs=nullptr; Match* matches=nullptr;
|
||||
uint32_t* counts=nullptr;uint32_t* good=nullptr;unsigned long long* total=nullptr;
|
||||
cudaEvent_t start,stop;
|
||||
Device(const std::vector<Position>& p){
|
||||
CUDA(cudaMalloc(&positions,p.size()*sizeof(Position)));CUDA(cudaMemcpy(positions,p.data(),p.size()*sizeof(Position),cudaMemcpyHostToDevice));
|
||||
CUDA(cudaMalloc(&jobs,JOB_CAPACITY*sizeof(Job)));CUDA(cudaMalloc(&matches,MATCH_CAPACITY*sizeof(Match)));
|
||||
CUDA(cudaMalloc(&counts,p.size()*sizeof(uint32_t)));CUDA(cudaMalloc(&total,sizeof(*total)));
|
||||
std::array<uint32_t,8192> bits{};
|
||||
for(uint32_t k=0;k<(1U<<18);++k)if(!((((k^uint32_t(sr::kCombinedXor))*uint32_t(sr::kJavaMultiplier)+11U)>>17)&1U))bits[k>>5]|=1U<<(k&31);
|
||||
CUDA(cudaMalloc(&good,sizeof(bits)));CUDA(cudaMemcpy(good,bits.data(),sizeof(bits),cudaMemcpyHostToDevice));
|
||||
CUDA(cudaEventCreate(&start));CUDA(cudaEventCreate(&stop));
|
||||
}
|
||||
~Device(){cudaFree(positions);cudaFree(jobs);cudaFree(matches);cudaFree(counts);cudaFree(total);cudaFree(good);cudaEventDestroy(start);cudaEventDestroy(stop);}
|
||||
float finish(){CUDA(cudaGetLastError());CUDA(cudaEventRecord(stop));CUDA(cudaEventSynchronize(stop));float ms;CUDA(cudaEventElapsedTime(&ms,start,stop));return ms;}
|
||||
uint64_t totalCount(){unsigned long long n;CUDA(cudaMemcpy(&n,total,sizeof(n),cudaMemcpyDeviceToHost));return n;}
|
||||
float roots(uint32_t n,int mode,bool collect){
|
||||
CUDA(cudaMemset(total,0,sizeof(*total)));CUDA(cudaMemset(counts,0,n*sizeof(uint32_t)));CUDA(cudaEventRecord(start));
|
||||
unsigned blocks=unsigned(((uint64_t(n)<<18)+255)/256);
|
||||
if(mode==0)rootKernel<0><<<blocks,256>>>(positions,n,good,counts,jobs,total,collect);
|
||||
else rootKernel<1><<<blocks,256>>>(positions,n,good,counts,jobs,total,collect);
|
||||
return finish();
|
||||
}
|
||||
float search(uint32_t n,int mode){
|
||||
CUDA(cudaMemset(total,0,sizeof(*total)));CUDA(cudaEventRecord(start));
|
||||
unsigned blocks=unsigned(((uint64_t(n)<<17)+255)/256);
|
||||
if(blocks){
|
||||
if(mode==0)searchKernel<0><<<blocks,256>>>(positions,jobs,n,matches,total);
|
||||
if(mode==1)searchKernel<1><<<blocks,256>>>(positions,jobs,n,matches,total);
|
||||
if(mode==2)searchKernel<2><<<blocks,256>>>(positions,jobs,n,matches,total);
|
||||
if(mode==3)searchKernel<3><<<blocks,256>>>(positions,jobs,n,matches,total);
|
||||
}
|
||||
return finish();
|
||||
}
|
||||
std::vector<Match> results(){
|
||||
uint64_t n=totalCount();if(n>MATCH_CAPACITY)throw std::runtime_error("match overflow");
|
||||
std::vector<Match> r(n);CUDA(cudaMemcpy(r.data(),matches,n*sizeof(Match),cudaMemcpyDeviceToHost));std::sort(r.begin(),r.end());return r;
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc,char**argv){
|
||||
try{
|
||||
if(argc<3)throw std::runtime_error("usage: cuda_bench positions.txt root|compare|fast|tail|complete [repeats=5] [tail-cells=25]");
|
||||
std::ifstream in(argv[1]);if(!in)throw std::runtime_error("cannot open positions");
|
||||
int32_t x,z;std::vector<Position> positions;while(in>>x>>z)positions.push_back(makePosition(x,z));
|
||||
if(positions.empty()||positions.size()>65536)throw std::runtime_error("position count must be 1..65536");
|
||||
std::string task=argv[2];int repeats=argc>3?std::stoi(argv[3]):5;
|
||||
int tailCells=argc>4?std::stoi(argv[4]):25;
|
||||
if(tailCells<1||tailCells>25)throw std::runtime_error("tail-cells must be 1..25");
|
||||
auto processStart=Clock::now();Device d(positions);
|
||||
std::cout<<std::setprecision(10);
|
||||
cudaDeviceProp prop{};CUDA(cudaGetDeviceProperties(&prop,0));std::cout<<"{\"type\":\"device\",\"name\":\""<<prop.name<<"\",\"positions\":"<<positions.size()<<"}"<<std::endl;
|
||||
std::vector<uint32_t> referenceCounts;
|
||||
std::vector<Job> referenceJobs;
|
||||
auto collectRoots=[&](int mode){
|
||||
float ms=d.roots(positions.size(),mode,true);uint64_t total=d.totalCount();if(total>JOB_CAPACITY)throw std::runtime_error("job overflow");
|
||||
std::vector<uint32_t> counts(positions.size());CUDA(cudaMemcpy(counts.data(),d.counts,counts.size()*sizeof(uint32_t),cudaMemcpyDeviceToHost));
|
||||
std::vector<Job> jobs(total);CUDA(cudaMemcpy(jobs.data(),d.jobs,total*sizeof(Job),cudaMemcpyDeviceToHost));
|
||||
std::sort(jobs.begin(),jobs.end(),[](Job a,Job b){return std::tie(a.position,a.root)<std::tie(b.position,b.root);});
|
||||
if(referenceCounts.empty()){referenceCounts=counts;referenceJobs=jobs;}
|
||||
else {
|
||||
if(counts!=referenceCounts||jobs.size()!=referenceJobs.size())throw std::runtime_error("root mismatch");
|
||||
for(size_t i=0;i<jobs.size();++i)if(jobs[i].position!=referenceJobs[i].position||jobs[i].root!=referenceJobs[i].root)throw std::runtime_error("root list mismatch");
|
||||
}
|
||||
return ms;
|
||||
};
|
||||
if(task=="root"){
|
||||
collectRoots(0);collectRoots(1);
|
||||
for(int r=0;r<repeats;++r)for(int k=0;k<2;++k){int mode=(r+k)%2;float ms=collectRoots(mode);std::cout<<"{\"type\":\"root_timing\",\"mode\":"<<mode<<",\"round\":"<<r<<",\"kernel_ms\":"<<ms<<"}"<<std::endl;}
|
||||
}else if(task=="tail"){
|
||||
std::vector<Match> expected;
|
||||
for(int r=-1;r<repeats;++r)for(int k=0;k<2;++k){
|
||||
const int mode=r<0?k:(r+k)%2;
|
||||
CUDA(cudaMemset(d.total,0,sizeof(*d.total)));CUDA(cudaEventRecord(d.start));
|
||||
const uint64_t work=mode==0?uint64_t(positions.size())*tailCells*(1U<<20):(uint64_t(positions.size())<<18);
|
||||
if((work+255)/256>0x7fffffffULL)throw std::runtime_error("tail grid too large");
|
||||
unsigned blocks=unsigned((work+255)/256);
|
||||
if(mode==0)tailKernel<<<blocks,256>>>(d.positions,positions.size(),d.matches,d.total,tailCells);
|
||||
else canonicalTailKernel<<<blocks,256>>>(d.positions,positions.size(),d.matches,d.total,tailCells);
|
||||
float ms=d.finish();auto result=d.results();
|
||||
result.erase(std::unique(result.begin(),result.end()),result.end());
|
||||
if(r==-1&&mode==0)expected=result;else if(result!=expected)throw std::runtime_error("tail mismatch");
|
||||
if(r>=0)std::cout<<"{\"type\":\"tail_timing\",\"mode\":"<<mode<<",\"cells\":"<<tailCells<<",\"round\":"<<r<<",\"kernel_ms\":"<<ms<<",\"matches\":"<<result.size()<<"}"<<std::endl;
|
||||
}
|
||||
std::cout<<"{\"type\":\"process\",\"ms\":"<<std::chrono::duration<double,std::milli>(Clock::now()-processStart).count()<<"}"<<std::endl;return 0;
|
||||
}else if(task=="complete"){
|
||||
const float rootMs=collectRoots(0);
|
||||
CUDA(cudaMemcpy(d.jobs,referenceJobs.data(),referenceJobs.size()*sizeof(Job),cudaMemcpyHostToDevice));
|
||||
std::vector<Match> expected;
|
||||
for(int r=-1;r<repeats;++r){
|
||||
auto wallStart=Clock::now();
|
||||
const float firstMs=d.search(referenceJobs.size(),3);
|
||||
auto result=d.results();
|
||||
CUDA(cudaMemset(d.total,0,sizeof(*d.total)));CUDA(cudaEventRecord(d.start));
|
||||
const unsigned blocks=unsigned(((uint64_t(positions.size())<<18)+255)/256);
|
||||
canonicalTailKernel<<<blocks,256>>>(d.positions,positions.size(),d.matches,d.total,25);
|
||||
const float tailMs=d.finish();auto tail=d.results();
|
||||
result.insert(result.end(),tail.begin(),tail.end());std::sort(result.begin(),result.end());
|
||||
result.erase(std::unique(result.begin(),result.end()),result.end());
|
||||
if(r==-1)expected=result;else if(result!=expected)throw std::runtime_error("complete pipeline result mismatch");
|
||||
if(r>=0)std::cout<<"{\"type\":\"complete_timing\",\"round\":"<<r<<",\"first_ms\":"<<firstMs
|
||||
<<",\"tail_ms\":"<<tailMs<<",\"compute_ms\":"<<(firstMs+tailMs)
|
||||
<<",\"scan_ms\":"<<std::chrono::duration<double,std::milli>(Clock::now()-wallStart).count()
|
||||
<<",\"matches\":"<<result.size()<<"}"<<std::endl;
|
||||
}
|
||||
std::cout<<"{\"type\":\"complete_info\",\"root_ms\":"<<rootMs<<",\"jobs\":"<<referenceJobs.size()<<",\"matches\":[";
|
||||
for(size_t i=0;i<expected.size();++i){if(i)std::cout<<",";const auto& p=positions[expected[i].position];std::cout<<"["<<expected[i].seed<<","<<p.x<<","<<p.z<<"]";}std::cout<<"]}"<<std::endl;
|
||||
}else{
|
||||
float rootMs=collectRoots(0);
|
||||
CUDA(cudaMemcpy(d.jobs,referenceJobs.data(),referenceJobs.size()*sizeof(Job),cudaMemcpyHostToDevice));
|
||||
std::vector<Match> expected;
|
||||
const std::vector<int> modes=task=="compare"?std::vector<int>{0,1,2,3}:std::vector<int>{1,2,3};
|
||||
bool first=true;
|
||||
for(int m:modes){d.search(referenceJobs.size(),m);auto r=d.results();if(first){expected=r;first=false;}else if(r!=expected)throw std::runtime_error("warmup result mismatch");}
|
||||
for(int r=0;r<repeats;++r)for(size_t k=0;k<modes.size();++k){
|
||||
int mode=modes[(k+r)%modes.size()];auto wallStart=Clock::now();float ms=d.search(referenceJobs.size(),mode);auto result=d.results();
|
||||
if(result!=expected)throw std::runtime_error("search result mismatch");
|
||||
std::cout<<"{\"type\":\"search_timing\",\"mode\":"<<mode<<",\"round\":"<<r<<",\"kernel_ms\":"<<ms<<",\"scan_ms\":"<<std::chrono::duration<double,std::milli>(Clock::now()-wallStart).count()<<",\"matches\":"<<result.size()<<"}"<<std::endl;
|
||||
}
|
||||
std::cout<<"{\"type\":\"search_info\",\"root_ms\":"<<rootMs<<",\"jobs\":"<<referenceJobs.size()<<",\"lower35\":"<<(uint64_t(referenceJobs.size())<<17)<<",\"matches\":[";
|
||||
for(size_t i=0;i<expected.size();++i){if(i)std::cout<<",";const auto& p=positions[expected[i].position];std::cout<<"["<<expected[i].seed<<","<<p.x<<","<<p.z<<"]";}std::cout<<"]}"<<std::endl;
|
||||
}
|
||||
// CPU checks of complete low18 root lists, including varied coordinates.
|
||||
for(size_t n=0;n<std::min<size_t>(64,positions.size());++n){
|
||||
size_t pos=n*positions.size()/std::min<size_t>(64,positions.size());std::vector<uint32_t> cpu,gpu;
|
||||
for(uint32_t s=0;s<(1U<<18);++s)if(sr::partialPatternPossible(s,18,positions[pos].cells,25))cpu.push_back(s);
|
||||
for(auto j:referenceJobs)if(j.position==pos)gpu.push_back(j.root);
|
||||
if(cpu!=gpu)throw std::runtime_error("CPU/GPU roots mismatch");
|
||||
}
|
||||
std::map<uint64_t,std::vector<uint32_t>> classes;
|
||||
size_t offset=0;
|
||||
for(size_t pos=0;pos<positions.size();++pos){
|
||||
uint64_t key=(uint64_t(uint32_t(positions[pos].x)&65535)<<17)|(uint32_t(positions[pos].z)&131071);
|
||||
std::vector<uint32_t> roots;
|
||||
while(offset<referenceJobs.size()&&referenceJobs[offset].position==pos)roots.push_back(referenceJobs[offset++].root);
|
||||
auto it=classes.find(key);
|
||||
if(it==classes.end())classes.emplace(key,std::move(roots));
|
||||
else if(it->second!=roots)throw std::runtime_error("periodic class root list mismatch");
|
||||
}
|
||||
std::cout<<"{\"type\":\"periodic_validation\",\"classes\":"<<classes.size()<<",\"positions\":"<<positions.size()<<",\"equal\":true}"<<std::endl;
|
||||
std::cout<<"{\"type\":\"root_counts\",\"counts\":[";for(size_t i=0;i<referenceCounts.size();++i){if(i)std::cout<<",";std::cout<<referenceCounts[i];}std::cout<<"]}"<<std::endl;
|
||||
std::cout<<"{\"type\":\"process\",\"ms\":"<<std::chrono::duration<double,std::milli>(Clock::now()-processStart).count()<<"}"<<std::endl;
|
||||
}catch(const std::exception&e){std::cerr<<e.what()<<"\n";return 1;}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
// Compatibility include for historical experiment entrypoints.
|
||||
#include "../../../include/slime/upper_interval.hpp"
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
20508 90242
|
||||
54865 12632
|
||||
57808 83448
|
||||
45571 7025
|
||||
41354 55843
|
||||
17402 110862
|
||||
8259 107266
|
||||
43482 107388
|
||||
61898 108538
|
||||
58072 45380
|
||||
2384 37823
|
||||
56566 33756
|
||||
54050 33180
|
||||
48027 41698
|
||||
26400 127463
|
||||
13969 27082
|
||||
63274 45862
|
||||
51826 109902
|
||||
35332 113389
|
||||
55589 46936
|
||||
6571 80653
|
||||
40963 108250
|
||||
8207 115527
|
||||
65432 46739
|
||||
1632 44691
|
||||
14689 90828
|
||||
13769 13900
|
||||
45145 91692
|
||||
57059 84915
|
||||
19692 116595
|
||||
65533 67472
|
||||
49762 93725
|
||||
|
|
@ -0,0 +1 @@
|
|||
51069 419124
|
||||
|
|
@ -0,0 +1 @@
|
|||
[1596, 1653, 1596, 1653, 1596, 1653, 1653, 1653, 1653, 1596, 1653, 1653, 1653, 1596, 1682, 1653, 1596, 1653, 1682, 1596, 1596, 1653, 1653, 1596, 1596, 1596, 1653, 1653, 1596, 1653, 1596, 1653]
|
||||
52213
research/experiments/full_search_feasibility/positions/lifts.txt
Normal file
52213
research/experiments/full_search_feasibility/positions/lifts.txt
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
65536
research/experiments/full_search_feasibility/positions/random65536.txt
Normal file
65536
research/experiments/full_search_feasibility/positions/random65536.txt
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,21 @@
|
|||
51069 419124
|
||||
51069 419125
|
||||
51070 419124
|
||||
51068 419124
|
||||
51069 419123
|
||||
51071 419124
|
||||
51069 419126
|
||||
51071 419126
|
||||
51067 419122
|
||||
51068 419125
|
||||
51070 419123
|
||||
51072 419124
|
||||
51069 419127
|
||||
51072 419127
|
||||
51066 419124
|
||||
51069 419121
|
||||
0 0
|
||||
-1875000 -1875000
|
||||
1874995 1874995
|
||||
2147483643 2147483643
|
||||
-2147483648 -2147483648
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
51069 419124
|
||||
-151639 -947718
|
||||
1628807 1768848
|
||||
183149 -1355854
|
||||
399809 180074
|
||||
1331359 -949016
|
||||
-928444 -1623457
|
||||
-434111 1380151
|
||||
152758 -903569
|
||||
1573808 123536
|
||||
1439373 -1760847
|
||||
751203 -1435166
|
||||
610332 1532034
|
||||
-1825025 -1355719
|
||||
-115982 205535
|
||||
1824337 -1691304
|
||||
653615 -1196891
|
||||
70982 -1096949
|
||||
471686 101463
|
||||
-1283834 -394356
|
||||
-1077237 -730018
|
||||
1639252 1254113
|
||||
798574 629823
|
||||
27251 -1281168
|
||||
187989 -364498
|
||||
-1749840 1146587
|
||||
800514 -1729353
|
||||
-1222320 1829300
|
||||
-21017 1801614
|
||||
381104 -1778790
|
||||
-913761 1285921
|
||||
-1326869 -862681
|
||||
753606 -1698600
|
||||
861651 1158886
|
||||
-853922 -1012344
|
||||
409724 1445621
|
||||
820384 -678458
|
||||
103226 1272878
|
||||
1600737 263564
|
||||
-506130 -1245993
|
||||
-825723 449811
|
||||
-1683685 -40291
|
||||
-1566877 1270725
|
||||
-1224693 -1550920
|
||||
-643224 416976
|
||||
1637732 1161249
|
||||
-540219 629696
|
||||
385799 1463828
|
||||
1235472 -549937
|
||||
1456601 -972438
|
||||
416534 -1635641
|
||||
-1301541 -1746936
|
||||
-1594959 -463516
|
||||
1204858 -33676
|
||||
-764975 64792
|
||||
-123655 -117892
|
||||
-255226 -926872
|
||||
838204 1645544
|
||||
1859060 -694124
|
||||
-161268 -914208
|
||||
-1466503 385080
|
||||
411691 -631360
|
||||
1613179 175007
|
||||
-1629505 -215899
|
||||
-1766803 1662240
|
||||
-298802 1780132
|
||||
-966039 -1151326
|
||||
-1397810 1758470
|
||||
-1180783 -884455
|
||||
-1857260 -966834
|
||||
1432151 1219727
|
||||
-1042318 166210
|
||||
1695758 1454030
|
||||
1282751 1461553
|
||||
1047318 -175482
|
||||
-1264922 -901360
|
||||
1361879 -1342934
|
||||
-190193 1035186
|
||||
786218 382124
|
||||
-441325 310526
|
||||
274023 1368323
|
||||
1005396 -1205652
|
||||
1345022 -242369
|
||||
1362954 -120311
|
||||
688497 -1303174
|
||||
184270 -1475672
|
||||
1697223 -841268
|
||||
909342 1403124
|
||||
-518834 -1841162
|
||||
-457099 -712327
|
||||
-1061496 -1132296
|
||||
-1568524 209693
|
||||
862602 213688
|
||||
725831 -374225
|
||||
-955021 1598463
|
||||
-1242843 706739
|
||||
-928275 1211740
|
||||
-97386 26812
|
||||
-159596 -898691
|
||||
559750 -919322
|
||||
-1261526 -1170283
|
||||
1217562 -1802980
|
||||
-273908 -438569
|
||||
948984 915311
|
||||
-1190015 -773822
|
||||
500811 -295186
|
||||
-489265 1081569
|
||||
1816094 -1831463
|
||||
1168538 105449
|
||||
1031166 1699672
|
||||
319995 -1076966
|
||||
-723529 -385152
|
||||
-1043111 1661566
|
||||
1503451 -1847764
|
||||
477739 -899398
|
||||
-697019 1039008
|
||||
1089311 1472213
|
||||
1205717 566995
|
||||
-1189155 303581
|
||||
75335 964912
|
||||
1716857 -1068302
|
||||
-1646128 1525240
|
||||
-526278 1172893
|
||||
-478717 -1696911
|
||||
-1648970 1053068
|
||||
-294273 -392369
|
||||
-341537 1585086
|
||||
431026 -1312089
|
||||
254976
research/experiments/full_search_feasibility/results/all.json
Normal file
254976
research/experiments/full_search_feasibility/results/all.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,14 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":32}
|
||||
{"type":"root_timing","mode":0,"round":0,"kernel_ms":0.1382399946}
|
||||
{"type":"root_timing","mode":1,"round":0,"kernel_ms":0.2088959962}
|
||||
{"type":"root_timing","mode":1,"round":1,"kernel_ms":0.2088959962}
|
||||
{"type":"root_timing","mode":0,"round":1,"kernel_ms":0.1351680011}
|
||||
{"type":"root_timing","mode":0,"round":2,"kernel_ms":0.1382399946}
|
||||
{"type":"root_timing","mode":1,"round":2,"kernel_ms":0.2037760019}
|
||||
{"type":"root_timing","mode":1,"round":3,"kernel_ms":0.2283519953}
|
||||
{"type":"root_timing","mode":0,"round":3,"kernel_ms":0.1648640037}
|
||||
{"type":"root_timing","mode":0,"round":4,"kernel_ms":0.1587200016}
|
||||
{"type":"root_timing","mode":1,"round":4,"kernel_ms":0.2088959962}
|
||||
{"type":"periodic_validation","classes":32,"positions":32,"equal":true}
|
||||
{"type":"root_counts","counts":[21,1,4,40,24,1,1,91,3,47,16,15,4,412,1,14,3,5,28,1,2,1,4,7,2,9,34,1,1,3,226,28]}
|
||||
{"type":"process","ms":249.778637}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,10 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":21}
|
||||
{"type":"complete_timing","round":0,"first_ms":1.288192034,"tail_ms":0.7680000067,"compute_ms":2.056191921,"scan_ms":2.294025,"matches":24}
|
||||
{"type":"complete_timing","round":1,"first_ms":1.290240049,"tail_ms":0.7680000067,"compute_ms":2.058239937,"scan_ms":2.245116,"matches":24}
|
||||
{"type":"complete_timing","round":2,"first_ms":1.289216042,"tail_ms":0.7680000067,"compute_ms":2.057216167,"scan_ms":2.231547,"matches":24}
|
||||
{"type":"complete_timing","round":3,"first_ms":1.290240049,"tail_ms":0.7680000067,"compute_ms":2.058239937,"scan_ms":2.249119,"matches":24}
|
||||
{"type":"complete_timing","round":4,"first_ms":1.289216042,"tail_ms":0.7690240145,"compute_ms":2.058239937,"scan_ms":2.262982,"matches":24}
|
||||
{"type":"complete_info","root_ms":1.327103972,"jobs":474,"matches":[[10358701894766,51069,419124],[15959335054446,51069,419124],[18914276748398,51069,419124],[24514909908078,51069,419124],[27469851602030,51069,419124],[33070484761710,51069,419124],[36025426455662,51069,419124],[41626059615342,51069,419124],[44581001309294,51069,419124],[50181634468974,51069,419124],[53136576162926,51069,419124],[58737209322606,51069,419124],[61692151016558,51069,419124],[67292784176238,51069,419124],[70247725870190,51069,419124],[75848359029870,51069,419124],[78803300723822,51069,419124],[84403933883502,51069,419124],[87358875577454,51069,419124],[92959508737134,51069,419124],[95914450431086,51069,419124],[101515083590766,51069,419124],[104470025284718,51069,419124],[110070658444398,51069,419124]]}
|
||||
{"type":"periodic_validation","classes":20,"positions":21,"equal":true}
|
||||
{"type":"root_counts","counts":[84,152,16,0,2,20,61,22,0,1,35,30,20,29,0,2,0,0,0,0,0]}
|
||||
{"type":"process","ms":271.397062}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"upper_planes":4096,"direct_seeds":33554432,"tail_states":1048576,"tail_slime":104848,"odd_tail_slime":52422,"periodicity_cells":250000,"passed":true}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"independent_python_java_verification": true,
|
||||
"unique_verified_matches": 24
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":1}
|
||||
{"type":"search_timing","mode":0,"round":0,"kernel_ms":65.88722992,"scan_ms":64.322731,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":0,"kernel_ms":0.7966719866,"scan_ms":0.989482,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":0,"kernel_ms":0.3901439905,"scan_ms":0.568541,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":0,"kernel_ms":0.3235839903,"scan_ms":0.475938,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":1,"kernel_ms":0.7956479788,"scan_ms":0.931277,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":1,"kernel_ms":0.3921920061,"scan_ms":0.537933,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":1,"kernel_ms":0.318464011,"scan_ms":0.484489,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":1,"kernel_ms":67.21331024,"scan_ms":65.89873,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":2,"kernel_ms":0.3983359933,"scan_ms":0.656092,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":2,"kernel_ms":0.3235839903,"scan_ms":0.448731,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":2,"kernel_ms":63.08863831,"scan_ms":61.613729,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":2,"kernel_ms":0.7587839961,"scan_ms":0.978891,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":3,"kernel_ms":0.5212159753,"scan_ms":1.030974,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":3,"kernel_ms":62.64831924,"scan_ms":61.355937,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":3,"kernel_ms":0.7587839961,"scan_ms":0.913884,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":3,"kernel_ms":0.3696640134,"scan_ms":0.516653,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":4,"kernel_ms":63.75014496,"scan_ms":62.243002,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":4,"kernel_ms":0.7628800273,"scan_ms":0.910191,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":4,"kernel_ms":0.3768320084,"scan_ms":0.498385,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":4,"kernel_ms":0.3102720082,"scan_ms":0.436487,"matches":24}
|
||||
{"type":"search_info","root_ms":0.8509439826,"jobs":84,"lower35":11010048,"matches":[[10358701894766,51069,419124],[15959335054446,51069,419124],[18914276748398,51069,419124],[24514909908078,51069,419124],[27469851602030,51069,419124],[33070484761710,51069,419124],[36025426455662,51069,419124],[41626059615342,51069,419124],[44581001309294,51069,419124],[50181634468974,51069,419124],[53136576162926,51069,419124],[58737209322606,51069,419124],[61692151016558,51069,419124],[67292784176238,51069,419124],[70247725870190,51069,419124],[75848359029870,51069,419124],[78803300723822,51069,419124],[84403933883502,51069,419124],[87358875577454,51069,419124],[92959508737134,51069,419124],[95914450431086,51069,419124],[101515083590766,51069,419124],[104470025284718,51069,419124],[110070658444398,51069,419124]]}
|
||||
{"type":"periodic_validation","classes":1,"positions":1,"equal":true}
|
||||
{"type":"root_counts","counts":[84]}
|
||||
{"type":"process","ms":618.005189}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,25 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":21}
|
||||
{"type":"search_timing","mode":0,"round":0,"kernel_ms":379.4073486,"scan_ms":368.969147,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":0,"kernel_ms":3.854336023,"scan_ms":3.911966,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":0,"kernel_ms":1.691648006,"scan_ms":1.808333,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":0,"kernel_ms":1.225728035,"scan_ms":1.328216,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":1,"kernel_ms":4.673535824,"scan_ms":4.759871,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":1,"kernel_ms":2.663424015,"scan_ms":2.865543,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":1,"kernel_ms":1.217535973,"scan_ms":1.325398,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":1,"kernel_ms":371.9034729,"scan_ms":362.378901,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":2,"kernel_ms":1.757184029,"scan_ms":1.912097,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":2,"kernel_ms":1.245183945,"scan_ms":1.355726,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":2,"kernel_ms":363.8763428,"scan_ms":356.104291,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":2,"kernel_ms":3.95571208,"scan_ms":4.099446,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":3,"kernel_ms":2.305023909,"scan_ms":2.485873,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":3,"kernel_ms":361.4719849,"scan_ms":353.99145,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":3,"kernel_ms":5.737472057,"scan_ms":5.931658,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":3,"kernel_ms":1.793023944,"scan_ms":2.044199,"matches":24}
|
||||
{"type":"search_timing","mode":0,"round":4,"kernel_ms":361.7187805,"scan_ms":354.316081,"matches":24}
|
||||
{"type":"search_timing","mode":1,"round":4,"kernel_ms":5.419007778,"scan_ms":5.597639,"matches":24}
|
||||
{"type":"search_timing","mode":2,"round":4,"kernel_ms":1.728512049,"scan_ms":1.845705,"matches":24}
|
||||
{"type":"search_timing","mode":3,"round":4,"kernel_ms":1.251327991,"scan_ms":1.363353,"matches":24}
|
||||
{"type":"search_info","root_ms":0.79974401,"jobs":474,"lower35":62128128,"matches":[[10358701894766,51069,419124],[15959335054446,51069,419124],[18914276748398,51069,419124],[24514909908078,51069,419124],[27469851602030,51069,419124],[33070484761710,51069,419124],[36025426455662,51069,419124],[41626059615342,51069,419124],[44581001309294,51069,419124],[50181634468974,51069,419124],[53136576162926,51069,419124],[58737209322606,51069,419124],[61692151016558,51069,419124],[67292784176238,51069,419124],[70247725870190,51069,419124],[75848359029870,51069,419124],[78803300723822,51069,419124],[84403933883502,51069,419124],[87358875577454,51069,419124],[92959508737134,51069,419124],[95914450431086,51069,419124],[101515083590766,51069,419124],[104470025284718,51069,419124],[110070658444398,51069,419124]]}
|
||||
{"type":"periodic_validation","classes":20,"positions":21,"equal":true}
|
||||
{"type":"root_counts","counts":[84,152,16,0,2,20,61,22,0,1,35,30,20,29,0,2,0,0,0,0,0]}
|
||||
{"type":"process","ms":2434.177987}
|
||||
|
|
@ -0,0 +1,499 @@
|
|||
{
|
||||
"known": {
|
||||
"kernel_median_ms": {
|
||||
"0": 63.75014496,
|
||||
"1": 0.7628800273,
|
||||
"2": 0.3901439905,
|
||||
"3": 0.3235839903
|
||||
},
|
||||
"type": "search_info",
|
||||
"root_ms": 0.8509439826,
|
||||
"jobs": 84,
|
||||
"lower35": 11010048,
|
||||
"matches": [
|
||||
[
|
||||
10358701894766,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
15959335054446,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
18914276748398,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
24514909908078,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
27469851602030,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
33070484761710,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
36025426455662,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
41626059615342,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
44581001309294,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
50181634468974,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
53136576162926,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
58737209322606,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
61692151016558,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
67292784176238,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
70247725870190,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
75848359029870,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
78803300723822,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
84403933883502,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
87358875577454,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
92959508737134,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
95914450431086,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
101515083590766,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
104470025284718,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
110070658444398,
|
||||
51069,
|
||||
419124
|
||||
]
|
||||
]
|
||||
},
|
||||
"stress": {
|
||||
"kernel_median_ms": {
|
||||
"0": 363.8763428,
|
||||
"1": 4.673535824,
|
||||
"2": 1.757184029,
|
||||
"3": 1.245183945
|
||||
},
|
||||
"type": "search_info",
|
||||
"root_ms": 0.79974401,
|
||||
"jobs": 474,
|
||||
"lower35": 62128128,
|
||||
"matches": [
|
||||
[
|
||||
10358701894766,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
15959335054446,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
18914276748398,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
24514909908078,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
27469851602030,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
33070484761710,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
36025426455662,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
41626059615342,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
44581001309294,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
50181634468974,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
53136576162926,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
58737209322606,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
61692151016558,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
67292784176238,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
70247725870190,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
75848359029870,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
78803300723822,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
84403933883502,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
87358875577454,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
92959508737134,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
95914450431086,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
101515083590766,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
104470025284718,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
110070658444398,
|
||||
51069,
|
||||
419124
|
||||
]
|
||||
]
|
||||
},
|
||||
"random4096": {
|
||||
"kernel_median_ms": {
|
||||
"0": 2318.624756,
|
||||
"1": 29.37958336,
|
||||
"2": 12.29721642,
|
||||
"3": 8.157183647
|
||||
},
|
||||
"type": "search_info",
|
||||
"root_ms": 16.9953289,
|
||||
"jobs": 2960,
|
||||
"lower35": 387973120,
|
||||
"matches": []
|
||||
},
|
||||
"random65536": {
|
||||
"kernel_median_ms": {
|
||||
"1": 407.6585083,
|
||||
"2": 175.9743958,
|
||||
"3": 131.6700134
|
||||
},
|
||||
"type": "search_info",
|
||||
"root_ms": 268.6993713,
|
||||
"jobs": 45356,
|
||||
"lower35": 5944901632,
|
||||
"matches": []
|
||||
},
|
||||
"distribution": {
|
||||
"positions": 65536,
|
||||
"roots": 45356,
|
||||
"mean": 0.69207763671875,
|
||||
"mean_normal95": [
|
||||
0.6105416864300699,
|
||||
0.7736135870074301
|
||||
],
|
||||
"zero_fraction": 0.9691619873046875,
|
||||
"max": 1015
|
||||
},
|
||||
"roots65536": {
|
||||
"0": 280.6394958,
|
||||
"1": 380.5327454
|
||||
},
|
||||
"classes32": {
|
||||
"0": 0.1382399946,
|
||||
"1": 0.2088959962
|
||||
},
|
||||
"lifts": {
|
||||
"0": 293.8664856,
|
||||
"1": 409.9522705
|
||||
},
|
||||
"tail_one_cell": {
|
||||
"kernel_median_ms": {
|
||||
"0": 0.03174399957,
|
||||
"1": 0.02559999935
|
||||
},
|
||||
"matches": 104848
|
||||
},
|
||||
"tail_two_cells": {
|
||||
"kernel_median_ms": {
|
||||
"0": 0.06451199949,
|
||||
"1": 0.0532479994
|
||||
},
|
||||
"matches": 20888
|
||||
},
|
||||
"tail_five_cells": {
|
||||
"kernel_median_ms": {
|
||||
"0": 0.1392640024,
|
||||
"1": 0.08396799862
|
||||
},
|
||||
"matches": 109
|
||||
},
|
||||
"tail128": {
|
||||
"kernel_median_ms": {
|
||||
"0": 93.59667206,
|
||||
"1": 3.907583952
|
||||
},
|
||||
"matches": 0
|
||||
},
|
||||
"projections": {
|
||||
"world_anchors": 14062500000000,
|
||||
"lower35_visits": 1.2756375e+18,
|
||||
"first_draw_kernel_years": 0.8952936774216201,
|
||||
"root_no_reuse_years": 1.908215543817446,
|
||||
"root_class_reuse_hours": 10.217772220416,
|
||||
"canonical_tail_kernel_years": 13.603695931457478,
|
||||
"complete_compute_years": 14.498989608879096,
|
||||
"complete_same_batch_kernel_years": 16.409789423895784,
|
||||
"complete_same_batch_scan_years": 16.024280153342424
|
||||
},
|
||||
"complete_stress": {
|
||||
"first_ms": 1.289216042,
|
||||
"tail_ms": 0.7680000067,
|
||||
"compute_ms": 2.058239937,
|
||||
"scan_ms": 2.249119,
|
||||
"type": "complete_info",
|
||||
"root_ms": 1.327103972,
|
||||
"jobs": 474,
|
||||
"matches": [
|
||||
[
|
||||
10358701894766,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
15959335054446,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
18914276748398,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
24514909908078,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
27469851602030,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
33070484761710,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
36025426455662,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
41626059615342,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
44581001309294,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
50181634468974,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
53136576162926,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
58737209322606,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
61692151016558,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
67292784176238,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
70247725870190,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
75848359029870,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
78803300723822,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
84403933883502,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
87358875577454,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
92959508737134,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
95914450431086,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
101515083590766,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
104470025284718,
|
||||
51069,
|
||||
419124
|
||||
],
|
||||
[
|
||||
110070658444398,
|
||||
51069,
|
||||
419124
|
||||
]
|
||||
]
|
||||
},
|
||||
"complete65536": {
|
||||
"first_ms": 129.1571198,
|
||||
"tail_ms": 2283.081787,
|
||||
"compute_ms": 2413.372559,
|
||||
"scan_ms": 2356.676067,
|
||||
"type": "complete_info",
|
||||
"root_ms": 296.572937,
|
||||
"jobs": 45356,
|
||||
"matches": []
|
||||
},
|
||||
"cache_counts_equal": true
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":128}
|
||||
{"type":"tail_timing","mode":0,"cells":25,"round":0,"kernel_ms":93.59667206,"matches":0}
|
||||
{"type":"tail_timing","mode":1,"cells":25,"round":0,"kernel_ms":3.907583952,"matches":0}
|
||||
{"type":"tail_timing","mode":1,"cells":25,"round":1,"kernel_ms":3.909631968,"matches":0}
|
||||
{"type":"tail_timing","mode":0,"cells":25,"round":1,"kernel_ms":93.7738266,"matches":0}
|
||||
{"type":"tail_timing","mode":0,"cells":25,"round":2,"kernel_ms":92.06886292,"matches":0}
|
||||
{"type":"tail_timing","mode":1,"cells":25,"round":2,"kernel_ms":5.363711834,"matches":0}
|
||||
{"type":"tail_timing","mode":1,"cells":25,"round":3,"kernel_ms":3.903487921,"matches":0}
|
||||
{"type":"tail_timing","mode":0,"cells":25,"round":3,"kernel_ms":91.83436584,"matches":0}
|
||||
{"type":"tail_timing","mode":0,"cells":25,"round":4,"kernel_ms":93.8915863,"matches":0}
|
||||
{"type":"tail_timing","mode":1,"cells":25,"round":4,"kernel_ms":3.904511929,"matches":0}
|
||||
{"type":"process","ms":778.407359}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":1}
|
||||
{"type":"tail_timing","mode":0,"cells":5,"round":0,"kernel_ms":0.1402879953,"matches":109}
|
||||
{"type":"tail_timing","mode":1,"cells":5,"round":0,"kernel_ms":0.08499199897,"matches":109}
|
||||
{"type":"tail_timing","mode":1,"cells":5,"round":1,"kernel_ms":0.08396799862,"matches":109}
|
||||
{"type":"tail_timing","mode":0,"cells":5,"round":1,"kernel_ms":0.1392640024,"matches":109}
|
||||
{"type":"tail_timing","mode":0,"cells":5,"round":2,"kernel_ms":0.1392640024,"matches":109}
|
||||
{"type":"tail_timing","mode":1,"cells":5,"round":2,"kernel_ms":0.08499199897,"matches":109}
|
||||
{"type":"tail_timing","mode":1,"cells":5,"round":3,"kernel_ms":0.08396799862,"matches":109}
|
||||
{"type":"tail_timing","mode":0,"cells":5,"round":3,"kernel_ms":0.1351680011,"matches":109}
|
||||
{"type":"tail_timing","mode":0,"cells":5,"round":4,"kernel_ms":0.1392640024,"matches":109}
|
||||
{"type":"tail_timing","mode":1,"cells":5,"round":4,"kernel_ms":0.08396799862,"matches":109}
|
||||
{"type":"process","ms":199.03863}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":1}
|
||||
{"type":"tail_timing","mode":0,"cells":1,"round":0,"kernel_ms":0.03174399957,"matches":104848}
|
||||
{"type":"tail_timing","mode":1,"cells":1,"round":0,"kernel_ms":0.02559999935,"matches":104848}
|
||||
{"type":"tail_timing","mode":1,"cells":1,"round":1,"kernel_ms":0.02559999935,"matches":104848}
|
||||
{"type":"tail_timing","mode":0,"cells":1,"round":1,"kernel_ms":0.03174399957,"matches":104848}
|
||||
{"type":"tail_timing","mode":0,"cells":1,"round":2,"kernel_ms":0.0308480002,"matches":104848}
|
||||
{"type":"tail_timing","mode":1,"cells":1,"round":2,"kernel_ms":0.0266239997,"matches":104848}
|
||||
{"type":"tail_timing","mode":1,"cells":1,"round":3,"kernel_ms":0.02559999935,"matches":104848}
|
||||
{"type":"tail_timing","mode":0,"cells":1,"round":3,"kernel_ms":0.03190400079,"matches":104848}
|
||||
{"type":"tail_timing","mode":0,"cells":1,"round":4,"kernel_ms":0.03174399957,"matches":104848}
|
||||
{"type":"tail_timing","mode":1,"cells":1,"round":4,"kernel_ms":0.02559999935,"matches":104848}
|
||||
{"type":"process","ms":294.256955}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{"type":"device","name":"NVIDIA GeForce RTX 3060 Laptop GPU","positions":1}
|
||||
{"type":"tail_timing","mode":0,"cells":2,"round":0,"kernel_ms":0.06451199949,"matches":20888}
|
||||
{"type":"tail_timing","mode":1,"cells":2,"round":0,"kernel_ms":0.05017599836,"matches":20888}
|
||||
{"type":"tail_timing","mode":1,"cells":2,"round":1,"kernel_ms":0.0532479994,"matches":20888}
|
||||
{"type":"tail_timing","mode":0,"cells":2,"round":1,"kernel_ms":0.06451199949,"matches":20888}
|
||||
{"type":"tail_timing","mode":0,"cells":2,"round":2,"kernel_ms":0.06553599983,"matches":20888}
|
||||
{"type":"tail_timing","mode":1,"cells":2,"round":2,"kernel_ms":0.05734400079,"matches":20888}
|
||||
{"type":"tail_timing","mode":1,"cells":2,"round":3,"kernel_ms":0.0532479994,"matches":20888}
|
||||
{"type":"tail_timing","mode":0,"cells":2,"round":3,"kernel_ms":0.06041600183,"matches":20888}
|
||||
{"type":"tail_timing","mode":0,"cells":2,"round":4,"kernel_ms":0.06656000018,"matches":20888}
|
||||
{"type":"tail_timing","mode":1,"cells":2,"round":4,"kernel_ms":0.04915200174,"matches":20888}
|
||||
{"type":"process","ms":224.394511}
|
||||
195
research/experiments/full_search_feasibility/run.py
Normal file
195
research/experiments/full_search_feasibility/run.py
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Reproducible CPU validation and sequential CUDA experiments (no network)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import platform
|
||||
import random
|
||||
import statistics
|
||||
import subprocess
|
||||
import time
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
POS = HERE / "positions"
|
||||
OUT = HERE / "results"
|
||||
BIN = "/tmp/slime_feasibility_cuda"
|
||||
|
||||
|
||||
def save_positions(name, points):
|
||||
(POS / f"{name}.txt").write_text("".join(f"{x} {z}\n" for x, z in points))
|
||||
|
||||
|
||||
def prepare():
|
||||
POS.mkdir(exist_ok=True)
|
||||
OUT.mkdir(exist_ok=True)
|
||||
save_positions("known", [(51069, 419124)])
|
||||
offsets = [(0, 0), (0, 1), (1, 0), (-1, 0), (0, -1), (2, 0), (0, 2),
|
||||
(2, 2), (-2, -2), (-1, 1), (1, -1), (3, 0), (0, 3), (3, 3),
|
||||
(-3, 0), (0, -3)]
|
||||
save_positions("stress", [(51069 + x, 419124 + z) for x, z in offsets] +
|
||||
[(0, 0), (-1875000, -1875000), (1874995, 1874995),
|
||||
(2147483643, 2147483643), (-2147483648, -2147483648)])
|
||||
rng = random.Random(2026101101)
|
||||
coords = [(rng.randrange(-1875000, 1875000), rng.randrange(-1875000, 1875000))
|
||||
for _ in range(65536)]
|
||||
save_positions("random4096", coords[:4096])
|
||||
save_positions("random65536", coords)
|
||||
save_positions("tail128", [(51069, 419124)] + coords[:127])
|
||||
return coords
|
||||
|
||||
|
||||
def run_case(name, positions, task, repeats=5, cells=None):
|
||||
cmd = [BIN, str(POS / f"{positions}.txt"), task, str(repeats)]
|
||||
if cells is not None:
|
||||
cmd.append(str(cells))
|
||||
start = time.perf_counter()
|
||||
result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
|
||||
(OUT / f"{name}.jsonl").write_text(result.stdout)
|
||||
(OUT / f"{name}.stderr").write_text(result.stderr)
|
||||
if result.returncode:
|
||||
raise RuntimeError(f"{name} failed: {result.stderr}")
|
||||
rows = [json.loads(line) for line in result.stdout.splitlines()]
|
||||
record = {"command": cmd, "wall_ms": (time.perf_counter() - start) * 1000,
|
||||
"rows": rows}
|
||||
print(json.dumps({"finished": name, "wall_ms": record["wall_ms"]}), flush=True)
|
||||
return record
|
||||
|
||||
|
||||
def median(rows, kind, mode):
|
||||
return statistics.median(r["kernel_ms"] for r in rows
|
||||
if r["type"] == kind and r["mode"] == mode)
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--analyse-only", action="store_true")
|
||||
ap.add_argument("--complete-only", action="store_true")
|
||||
args = ap.parse_args()
|
||||
if args.analyse_only or args.complete_only:
|
||||
records = json.loads((OUT / "all.json").read_text())
|
||||
else:
|
||||
coords = prepare()
|
||||
subprocess.run(["nvcc", "-O3", "-std=c++17", "-arch=sm_86",
|
||||
str(HERE / "cuda_bench.cu"), "-o", BIN], check=True)
|
||||
subprocess.run(["g++", "-O3", "-std=c++17", "-march=native", "-Wall", "-Wextra",
|
||||
str(HERE / "cpu_verify.cpp"), "-o", "/tmp/slime_feasibility_verify"], check=True)
|
||||
cpu = subprocess.check_output(["/tmp/slime_feasibility_verify"], text=True)
|
||||
(OUT / "cpu_verify.json").write_text(cpu)
|
||||
gpu_query = ["nvidia-smi", "--query-gpu=name,driver_version,temperature.gpu,utilization.gpu", "--format=csv"]
|
||||
records = {"metadata": {
|
||||
"date": datetime.now(ZoneInfo("Asia/Hong_Kong")).isoformat(),
|
||||
"platform": platform.platform(), "cpu_validation": json.loads(cpu),
|
||||
"gpu_before": subprocess.check_output(gpu_query, text=True),
|
||||
"source_sha256": {p.name: hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
for p in [HERE / "cuda_bench.cu", HERE / "interval_solver.hpp",
|
||||
HERE / "cpu_verify.cpp", HERE / "run.py",
|
||||
HERE.parent.parent / "slime_solver_core.hpp",
|
||||
HERE.parents[2] / "include/slime/solver_core.hpp",
|
||||
HERE.parents[2] / "include/slime/upper_interval.hpp"]}}}
|
||||
|
||||
def record(name, positions, task, repeats=5, cells=None):
|
||||
records[name] = run_case(name, positions, task, repeats, cells)
|
||||
(OUT / "all.json").write_text(json.dumps(records, indent=2))
|
||||
|
||||
record("known", "known", "compare")
|
||||
record("stress", "stress", "compare")
|
||||
record("random4096", "random4096", "compare")
|
||||
record("random65536", "random65536", "fast")
|
||||
record("roots65536", "random65536", "root")
|
||||
counts = next(r["counts"] for r in records["random4096"]["rows"] if r["type"] == "root_counts")
|
||||
classes = [(x % 65536, z % 131072) for (x, z), n in zip(coords, counts) if n][:32]
|
||||
save_positions("classes32", classes)
|
||||
lifts, groups = [], []
|
||||
for x, z in classes:
|
||||
current = [(xx, zz)
|
||||
for xx in range(-1875000 + (x + 1875000) % 65536, 1875000, 65536)
|
||||
for zz in range(-1875000 + (z + 1875000) % 131072, 1875000, 131072)]
|
||||
groups.append(len(current))
|
||||
lifts.extend(current)
|
||||
save_positions("lifts", lifts)
|
||||
(POS / "lift_groups.json").write_text(json.dumps(groups))
|
||||
record("classes32", "classes32", "root")
|
||||
record("lifts", "lifts", "root")
|
||||
record("tail_one_cell", "known", "tail", cells=1)
|
||||
record("tail_two_cells", "known", "tail", cells=2)
|
||||
record("tail_five_cells", "known", "tail", cells=5)
|
||||
record("tail128", "tail128", "tail")
|
||||
records["metadata"]["gpu_after"] = subprocess.check_output(gpu_query, text=True)
|
||||
(OUT / "all.json").write_text(json.dumps(records, indent=2))
|
||||
|
||||
if not args.analyse_only:
|
||||
if args.complete_only:
|
||||
subprocess.run(["nvcc", "-O3", "-std=c++17", "-arch=sm_86",
|
||||
str(HERE / "cuda_bench.cu"), "-o", BIN], check=True)
|
||||
records["complete_stress"] = run_case("complete_stress", "stress", "complete")
|
||||
records["complete65536"] = run_case("complete65536", "random65536", "complete")
|
||||
records["metadata"]["complete_source_sha256"] = {
|
||||
p.name: hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
for p in [HERE / "cuda_bench.cu", HERE / "interval_solver.hpp", HERE / "run.py",
|
||||
HERE.parents[2] / "include/slime/solver_core.hpp",
|
||||
HERE.parents[2] / "include/slime/upper_interval.hpp"]}
|
||||
(OUT / "all.json").write_text(json.dumps(records, indent=2))
|
||||
|
||||
summary = {}
|
||||
for name in ["known", "stress", "random4096", "random65536"]:
|
||||
rows = records[name]["rows"]
|
||||
modes = sorted({r["mode"] for r in rows if r["type"] == "search_timing"})
|
||||
summary[name] = {"kernel_median_ms": {str(m): median(rows, "search_timing", m) for m in modes}}
|
||||
summary[name].update(next(r for r in rows if r["type"] == "search_info"))
|
||||
counts = next(r["counts"] for r in records["random65536"]["rows"] if r["type"] == "root_counts")
|
||||
n = len(counts)
|
||||
mean = statistics.mean(counts)
|
||||
sem = statistics.stdev(counts) / n**0.5
|
||||
summary["distribution"] = {"positions": n, "roots": sum(counts), "mean": mean,
|
||||
"mean_normal95": [mean - 1.96 * sem, mean + 1.96 * sem],
|
||||
"zero_fraction": counts.count(0) / n, "max": max(counts)}
|
||||
for name in ["roots65536", "classes32", "lifts"]:
|
||||
summary[name] = {str(m): median(records[name]["rows"], "root_timing", m) for m in [0, 1]}
|
||||
for name in ["tail_one_cell", "tail_two_cells", "tail_five_cells", "tail128"]:
|
||||
rows = records[name]["rows"]
|
||||
summary[name] = {"kernel_median_ms": {str(m): median(rows, "tail_timing", m) for m in [0, 1]},
|
||||
"matches": next(r["matches"] for r in rows if r["type"] == "tail_timing")}
|
||||
|
||||
# All projections are throughput extrapolations, not measured full-world scans.
|
||||
world = 3750000**2
|
||||
year = 365.25 * 86400
|
||||
fast_ms = summary["random65536"]["kernel_median_ms"]["3"]
|
||||
tail_ms = summary["tail128"]["kernel_median_ms"]["1"]
|
||||
root_ms = min(summary["roots65536"].values())
|
||||
summary["projections"] = {
|
||||
"world_anchors": world,
|
||||
"lower35_visits": world * mean * 131072,
|
||||
"first_draw_kernel_years": fast_ms / 1000 / n * world / year,
|
||||
"root_no_reuse_years": root_ms / 1000 / n * world / year,
|
||||
"root_class_reuse_hours": root_ms / 1000 / n * (2**33) / 3600,
|
||||
"canonical_tail_kernel_years": tail_ms / 1000 / 128 * world / year,
|
||||
"complete_compute_years": (fast_ms / 1000 / n + tail_ms / 1000 / 128) * world / year,
|
||||
}
|
||||
for name in ["complete_stress", "complete65536"]:
|
||||
if name in records:
|
||||
rows = records[name]["rows"]
|
||||
summary[name] = {key: statistics.median(r[key] for r in rows if r["type"] == "complete_timing")
|
||||
for key in ["first_ms", "tail_ms", "compute_ms", "scan_ms"]}
|
||||
summary[name].update(next(r for r in rows if r["type"] == "complete_info"))
|
||||
if "complete65536" in summary:
|
||||
summary["projections"]["complete_same_batch_kernel_years"] = summary["complete65536"]["compute_ms"] / 1000 / n * world / year
|
||||
summary["projections"]["complete_same_batch_scan_years"] = summary["complete65536"]["scan_ms"] / 1000 / n * world / year
|
||||
assert summary["complete_stress"]["matches"] == summary["stress"]["matches"]
|
||||
# Count equality is checked here; the CUDA program additionally compares complete
|
||||
# normalized root lists for every repeated coordinate class in its input.
|
||||
base_counts = next(r["counts"] for r in records["classes32"]["rows"] if r["type"] == "root_counts")
|
||||
lifted_counts = next(r["counts"] for r in records["lifts"]["rows"] if r["type"] == "root_counts")
|
||||
groups = json.loads((POS / "lift_groups.json").read_text())
|
||||
assert lifted_counts == [c for c, number in zip(base_counts, groups) for _ in range(number)]
|
||||
summary["cache_counts_equal"] = True
|
||||
(OUT / "summary.json").write_text(json.dumps(summary, indent=2))
|
||||
print(json.dumps(summary, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue