CUDALibraryProfile, CUDASymbolCatalog, ProjectStackDeclarator, ProofPipelineRunner, Sprint290IntegrationSummary. 25/25 tests passing. End-to-end proof: "GPU matrix multiply. JSON result serialization." -> cublas for compute.matrix, nlohmann_json for serialization.json. Phase 6: Library Dispatch COMPLETE (Sprints 286-290, steps 1958-1982). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
78 lines
2.7 KiB
C++
78 lines
2.7 KiB
C++
// Step 1982: Sprint 290 Integration — CUDA End-to-End Proof
|
|
//
|
|
// t1: runProof() produces >= 2 enriched contracts
|
|
// t2: verifyGPUMatrixMultiply passes (cublas selected)
|
|
// t3: verifyJSONSerialization passes (nlohmann_json selected)
|
|
// t4: GPU matrix multiply contract has non-empty preferredAPIs
|
|
// t5: Sprint290IntegrationSummary metadata correct
|
|
|
|
#include "Sprint290IntegrationSummary.h"
|
|
#include <iostream>
|
|
|
|
namespace ws = whetstone;
|
|
static int p = 0, f = 0;
|
|
#define T(n) { std::cout << " " << #n << "... "; }
|
|
#define P() { std::cout << "PASS\n"; ++p; }
|
|
#define F(m) { std::cout << "FAIL: " << m << "\n"; ++f; }
|
|
#define C(c, m) if (!(c)) { F(m); return; }
|
|
|
|
void t1() {
|
|
T(run_proof_produces_enriched_contracts);
|
|
auto contracts = ws::Sprint290IntegrationSummary::runProof();
|
|
C(contracts.size() >= 2, "at least 2 contracts");
|
|
for (const auto& c : contracts) {
|
|
C(c.isEnriched(), "all contracts enriched");
|
|
}
|
|
P();
|
|
}
|
|
|
|
void t2() {
|
|
T(verify_gpu_matrix_multiply_passes);
|
|
C(ws::Sprint290IntegrationSummary::verifyGPUMatrixMultiply(),
|
|
"verifyGPUMatrixMultiply");
|
|
P();
|
|
}
|
|
|
|
void t3() {
|
|
T(verify_json_serialization_passes);
|
|
C(ws::Sprint290IntegrationSummary::verifyJSONSerialization(),
|
|
"verifyJSONSerialization");
|
|
P();
|
|
}
|
|
|
|
void t4() {
|
|
T(gpu_matrix_contract_has_preferred_apis);
|
|
auto contracts = ws::Sprint290IntegrationSummary::runProof();
|
|
bool found = false;
|
|
for (const auto& c : contracts) {
|
|
if (c.operationDomain == "compute.matrix" && c.selectedLibrary == "cublas") {
|
|
C(!c.preferredAPIs.empty(), "preferredAPIs non-empty for cublas");
|
|
C(c.capabilityScore == 0.99f, "capabilityScore = 0.99");
|
|
found = true;
|
|
}
|
|
}
|
|
C(found, "cublas/compute.matrix contract found");
|
|
P();
|
|
}
|
|
|
|
void t5() {
|
|
T(sprint290_metadata_correct);
|
|
ws::Sprint290IntegrationSummary s;
|
|
C(s.stepsCompleted == 5, "5 steps");
|
|
C(s.success, "success");
|
|
C(s.sprintName() == "Sprint 290: CUDA End-to-End Proof", "sprintName");
|
|
// Also verify combined ledger has CUDA + nlohmann entries
|
|
auto ledger = ws::Sprint290IntegrationSummary::buildCombinedLedger();
|
|
C(ledger.score("cublas", "compute.matrix") == 0.99f, "cublas/compute.matrix in combined");
|
|
C(ledger.score("nlohmann_json", "serialization.json") == 0.92f, "nlohmann in combined");
|
|
C(ledger.score("cufft", "compute.fft") == 0.99f, "cufft/compute.fft in combined");
|
|
P();
|
|
}
|
|
|
|
int main() {
|
|
std::cout << "Step 1982: Sprint 290 Integration — CUDA End-to-End Proof\n";
|
|
t1(); t2(); t3(); t4(); t5();
|
|
std::cout << "\n" << p << "/" << (p + f) << " passed\n";
|
|
return f > 0 ? 1 : 0;
|
|
}
|