Commit2e58958aRecorded19 Oct 2026Repositorysigil-http3

Run spike regressions through a lean native test fixture

Changed
 scripts/generate-spike-tests.mjs    | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 scripts/phantom-spike-echo-check.sh | 10 +++++++---
 2 files changed, 69 insertions(+), 3 deletions(-)
Diff
scripts/generate-spike-tests.mjsadded
@@ -0,0 +1,62 @@
+1
// Linux direct native fixture, using the original test bodies verbatim.
+2
import { createHash } from 'node:crypto';
+3
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
+4
import { resolve } from 'node:path';
+5
+6
const files = ['frame', 'qpack', 'streams', 'control', 'request', 'connection',
+7
'webtransport-wire', 'webtransport-session', 'webtransport-router'].map(name => `test/test-${name}.sgl`);
+8
files.push(...['profile', 'echo', 'echo-integration', 'observations'].map(name => `tools/interop/test/test-${name}.sgl`));
+9
const imports = new Set(['(sigil io)', '(sigil process)']);
+10
const manifest = [];
+11
let total = 0;
+12
const bodies = files.map(file => {
+13
const text = readFileSync(file, 'utf8');
+14
const boundary = text.indexOf('\n\n');
+15
if (!text.startsWith('(import ') || boundary < 0) throw new Error('Unexpected test header: ' + file);
+16
const header = text.slice(0, boundary);
+17
for (const match of header.matchAll(/\(sigil [a-z0-9 -]+\)/g)) imports.add(match[0]);
+18
const body = text.slice(boundary + 2).trimEnd();
+19
const count = [...body.matchAll(/\(test\s+"/g)].length;
+20
total += count;
+21
manifest.push({ file, tests: count, sha256: createHash('sha256').update(text).digest('hex') });
+22
return body;
+23
});
+24
if (total !== 123) throw new Error('Expected all 123 unchanged test cases, found ' + total);
+25
mkdirSync('build/spike-tests/src/sigil/http3/spike', { recursive: true });
+26
writeFileSync('build/spike-echo/test-sources.json', JSON.stringify(manifest, null, 2) + '\n');
+27
writeFileSync('build/spike-tests/src/sigil/http3/spike/checks.sgl', `(define-library (sigil http3 spike checks)
+28
(import ${[...imports].join('\n ')})
+29
(export main)
+30
(begin
+31
${bodies.map(body => body.split('\n').map(line => ' ' + line).join('\n')).join('\n\n')}
+32
+33
(define (main . arguments)
+34
(let ((summary (run-tests-filtered (lambda (descriptor) #t))))
+35
(for-each
+36
(lambda (result)
+37
(unless (test-result-passed? result)
+38
(println "SPIKE-FAIL ~a: ~a" (test-result-name result) (test-result-message result))))
+39
(test-summary-results summary))
+40
(println "SPIKE-CHECKS total=~a passed=~a failed=~a"
+41
(test-summary-total summary) (test-summary-passed summary) (test-summary-failed summary))
+42
(exit (if (and (= (test-summary-total summary) 123) (= (test-summary-failed summary) 0)) 0 1))))))
+43
`);
+44
writeFileSync('build/spike-tests/package.sgl', `(package
+45
name: "sigil-http3-spike-checks"
+46
version: "0.1.0"
+47
sigil: "0.22"
+48
entry: '(sigil http3 spike checks)
+49
dependencies: (list
+50
(from-path dir: "../.." name: "sigil-http3")
+51
(from-path dir: "../../tools/interop" name: "sigil-http3-interop")
+52
(from-path dir: "../../.deps/sigil-quic" name: "sigil-quic")
+53
(from-git url: "codeberg:sigil/sigil-crypto" version: "^0.18.1")
+54
(from-git url: "codeberg:sigil/sigil" package: "sigil-test" version: "^0.22")
+55
(from-git url: "codeberg:sigil/sigil" package: "sigil-lib" version: "^0.22")
+56
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.22"))
+57
configs: (list
+58
(config name: 'native backend: 'native debug?: #f optimize: 2
+59
bundle?: #t output-dir: "build/native"))
+60
bundle-name: "http3-spike-checks")
+61
`);
+62
console.log('RESULT generated-native-checks=' + total + ' sourceFiles=' + manifest.length);
scripts/phantom-spike-echo-check.shmodified
@@ -26,12 +26,14 @@ bash scripts/prepare-quic.sh
26
test "$(git -C .deps/sigil-quic rev-parse HEAD)" = "$(cat quic.rev)"
27
export SIGIL_JOBS=1
28
unset SIGIL_REDIRECTS SIGIL_LIB SIGIL_LIB_PATH
+29
node scripts/generate-spike-tests.mjs > "$results/generate-tests.log" 2>&1
30
HTTP3_SDK_SOURCE="$sdk_source" node --input-type=module <<'WORKSPACE'
31
import { writeFileSync } from 'node:fs';
32
import { resolve } from 'node:path';
33
const sdk = process.env.HTTP3_SDK_SOURCE;
34
const members = ['sigil-lib', 'sigil-stdlib', 'sigil-test'].map(name => `${sdk}/packages/${name}`);
−34
members.push(resolve('.deps/sigil-quic'), resolve('.deps/sigil-nat'), resolve('.'), resolve('tools/interop'));
+35
members.push(resolve('.deps/sigil-quic'), resolve('.deps/sigil-nat'), resolve('.'), resolve('tools/interop'),
+36
resolve('build/spike-tests'));
37
writeFileSync('build/spike-native-workspace/package.sgl', `;; SPIKE ONLY: no product dependency locks or released pins are changed.
38
(workspace
39
name: "http3-spike-local-sdk"
@@ -68,8 +70,10 @@ for package in sigil-lib sigil-stdlib sigil-test; do
70
printf '%s %s\n' "$package" "$actual"
71
done > "$results/local-dependency-paths.txt"
72
cp "$workspace/.sigil/deps.index" "$results/deps.index"
−71
(cd "$workspace" && timeout --foreground 600 "$builder" test --config native \
−72
"$source_root"/test/*.sgl "$source_root"/tools/interop/test/*.sgl) > "$results/tests.log" 2>&1
+73
(cd "$workspace" && timeout --foreground 600 "$builder" build sigil-http3-spike-checks --config native) \
+74
> "$results/test-build.log" 2>&1
+75
timeout --foreground 180 "$workspace/build/native/bin/http3-spike-checks" > "$results/tests.log" 2>&1
+76
rg -q '^SPIKE-CHECKS total=123 passed=123 failed=0$' "$results/tests.log"
77
(cd "$workspace" && timeout --foreground 600 "$builder" build sigil-http3-interop --config native) \
78
> "$results/native-build.log" 2>&1
79
mkdir -p tools/interop/build/native/bin