Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .github/workflows/nor19-streamed-cached-verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: NOR-19 bounded-buffer cached public verifier CPU and memory

on:
push:
paths:
- 'research/nor19_streamed_verifier/**'
- '.github/workflows/nor19-streamed-cached-verifier.yml'
pull_request:
paths:
- 'research/nor19_streamed_verifier/**'
- '.github/workflows/nor19-streamed-cached-verifier.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
streamed-exact-parity-and-public-source-safety:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Test all five algorithms against original exact native public masks
run: python -m unittest research.nor19_streamed_verifier.test_streamed -v

original-hosted-public-fixture-and-memory-independent-audit:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Independently audit 64 native masks, 2240 original timing samples, 640 memory profiles and bigint products
run: |
python research/nor19_streamed_verifier/receipt_audit.py --check \
--archive research/nor19_streamed_verifier/results/nor19_original_hosted.zip

previously-unbenchmarked-public-fixture-and-memory:
needs: streamed-exact-parity-and-public-source-safety
runs-on: ubuntu-latest
timeout-minutes: 55
env:
PYTHONHASHSEED: '0'
OPENBLAS_NUM_THREADS: '1'
OMP_NUM_THREADS: '1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Regenerate NOR-18 source and hash-lock every original public input
run: |
python research/nor19_streamed_verifier/benchmark.py \
--make-fixture /tmp/nor19_public_fixture.json --check
- name: Benchmark five modes with seven measured repetitions and isolated memory passes
run: |
python research/nor19_streamed_verifier/benchmark.py \
--fixture /tmp/nor19_public_fixture.json \
--repetitions 7 --warmups 2 \
--check --out /tmp/nor19_full.json
- name: Independent policy mask, memory, timing and source-integrity audit
run: |
python - <<'PY'
from pathlib import Path
from hashlib import sha256
from collections import Counter
import json,math,statistics
fixture=Path('/tmp/nor19_public_fixture.json').read_bytes()
raw=Path('/tmp/nor19_full.json').read_bytes()
pub=json.loads(fixture)
x=json.loads(raw)
assert pub['schema']=='nor19.previously_untimed_public_source_64.v1'
assert pub['public_only'] and pub['private_program_identities_and_query_outputs_absent']
assert pub['previously_timed_NOR18R_source_indices_excluded']
assert pub['source_original_NOR18_sha256']=='9905aa23466b98ba2068e6daf9206d35c453b8b3b75bd27c3ab7ff8f0db4041b'
assert len(pub['cases'])==64
assert len(set(z['original_full_public_sha256'] for z in pub['cases']))==64
assert x['schema']=='nor19.streaming_memory_bounded_public_verifier.v1'
assert x['fixture_schema']==pub['schema']
assert x['fixture_sha256']==sha256(fixture).hexdigest()
assert x['case_count']==len(x['records'])==64
assert x['cohorts']==4
assert x['source_families']=={'late_source':32,'signed':16,'rational':16}
assert x['measured_repetitions']==7 and x['warmups']==2
assert x['algorithms']==['independent16','cached16','stream16_queryfirst','stream16_verifyfirst','chunk4_verifyfirst']
assert x['primary']=='stream16_verifyfirst'
assert len(set(z['public_sha256'] for z in x['records']))==64
assert all(z['exact_mask_and_certificate_parity'] for z in x['records'])
assert all(x['scope'][f] for f in (
'complete_public_original_masks_and_certificates_unchanged',
'previous_NOR18R_measured_cases_excluded',
'all_fixture_sources_match_original_NOR18_byte_locked_archive',
'all_five_query_simulations_recomputed_independently',
'withheld_true_future_and_program_identity_absent_from_fixture'))
for obs,public in zip(x['records'],pub['cases']):
assert obs['original_index']==public['original_index']
assert obs['public_sha256']==public['original_full_public_sha256']
assert obs['reference_mask']==public['original_exact_full_accept_mask']
assert obs['reference_unanimous']==public['original_public_future_output_identifiable']
assert len(obs['mode_samples_ns'])==5
for mode in x['algorithms']:
samples=obs['mode_samples_ns'][mode]
assert len(samples)==7
for s in samples:
assert s['total_ns']==s['query_ns']+s['verification_ns']+s['certificate_ns']
assert s['query_ns']>0 and s['verification_ns']>0
assert obs['complete_tracemalloc'][mode]['mask']==public['original_exact_full_accept_mask']
assert obs['verifier_only_tracemalloc'][mode]['mask']==public['original_exact_full_accept_mask']
assert obs['reciprocal_bigint_work'][mode]['R_integer_products']>0
assert x['materialized_demo_candidate_buffers_at_once_design']['stream16_verifyfirst']==0
assert x['materialized_demo_candidate_buffers_at_once_design']['chunk4_verifyfirst']==4
assert x['materialized_demo_candidate_buffers_at_once_design']['cached16']==32
assert x['primary_memory_block_bootstrap']['draws']==4096
assert x['primary_speed_block_bootstrap']['draws']==4096
assert x['primary_median_peak_ratio_threshold']==0.8
assert x['primary_faster_than_native_threshold']==2.0
assert x['primary_memory_win_case_threshold']==48
assert len(x['isolated_process_RSS_KiB'])==5
print('NOR19 HOST',x['host'])
print('NOR19 PRIMARY MEDIAN TRACEMALLOC PEAK RATIO STREAM/CACHE',x['primary_median_complete_peak_ratio_vs_cached'])
print('NOR19 LOWER PEAK CASES',x['primary_lower_peak_cases'],'/64')
print('NOR19 PRIMARY MEDIAN PAIRED CPU SPEEDUP NATIVE/STREAM',x['primary_median_total_native_over_stream_speedup'])
print('NOR19 FIRST PREREGISTERED PASS',x['primary_passed'])
print('NOR19 COHORT MEMORY BOOTSTRAP',x['primary_memory_block_bootstrap'])
print('NOR19 COHORT SPEED BOOTSTRAP',x['primary_speed_block_bootstrap'])
print('NOR19 MEDIAN AND BIGINT RESULTS',x['summary_all'])
print('NOR19 PER FAMILY',x['summary_by_family'])
print('NOR19 PROCESS RSS',x['isolated_process_RSS_KiB'])
print('NOR19 PUBLIC FIXTURE BYTES SHA256',len(fixture),sha256(fixture).hexdigest())
print('NOR19 FULL BENCHMARK BYTES SHA256',len(raw),sha256(raw).hexdigest())
PY
- uses: actions/upload-artifact@v4
with:
name: nor19-new64-public-fixture-and-five-mode-cpu-memory-results
path: |
/tmp/nor19_public_fixture.json
/tmp/nor19_full.json
Loading
Loading