HomeDocs-Technical WhitePaper12-EFT.WP.Methods.Repro v1.0

Appendix B Implementation Bindings and Function Prototypes


I. Scope and Objectives


II. Terms and Symbols


III. Design Principles and Binding Constraints


IV. Prototype Catalog and Parameters

  1. I30-1 freeze_environment(config:dict) -> EnvLock
    • Inputs: config (OS, kernel, drivers, libs, compiler, cpu_id, gpu_id, flags, rng_family).
    • Output: EnvLock.
    • Idempotency: normalize-serialize config as the idempotency domain.
    • Exception: E_ENV_DRIFT.
    • Note: EnvLock = hash( normalized(config) ).
  2. I30-2 emit_pipeline_card(state:any) -> dict
    • Inputs: state (DAG, I/O anchors, metrics, alerts).
    • Output: PipelineCard.
    • Idempotency: bound to state and EnvLock.
    • Exception: E_SCHEMA_MISMATCH.
  3. I30-3 run_benchmark_suite(card:dict) -> BenchReport
    • Inputs: PipelineCard (binding data and steps).
    • Output: BenchReport (per-case results, delta_psd, R_coef, partial score components).
    • Idempotency: bound to card, EnvLock, seed.
    • Exceptions: E_DATA_MISMATCH, E_NONDETERMINISM.
  4. I30-4 verify_reproduction(golden:any, candidate:any, metrics:dict) -> RepReport
    • Inputs: golden, candidate, metrics (gates and weights).
    • Output: RepReport (delta_rep, R_coef, delta_psd, gate.rep).
    • Idempotency: bound to golden/candidate fingerprints and metrics.
    • Exception: E_DATA_MISMATCH.
  5. I30-5 snapshot_provenance(artifacts:list) -> dict
    • Inputs: artifacts (files, models, cards, reports).
    • Output: { fingerprint:list, anchor:str }.
    • Idempotency: bound to artifact content and metadata.
    • Exception: E_SCHEMA_MISMATCH.
  6. I30-6 align_timebase(trace:any, reference:any) -> {alpha:float, beta:float, fit:dict}
    • Inputs: trace (internal tau_mono sequence), reference (external ts sequence).
    • Outputs: alpha, beta, fit (includes r_tb and residual breakdown).
    • Idempotency: bound to input sequences and fitting gauge.
    • Exception: E_TIMEBASE_SKEW.
    • Note: linear least squares or robust regression; report r_tb = ( norm( ts - ( alpha + beta * tau_mono ) ) / norm( ts ) ).
  7. I30-7 compare_psd(x:any, y:any, window:dict) -> { delta_psd:float, pass:bool }
    • Inputs: x, y (signals aligned to the same ts), window (w[n], U_w, ENBW, bandwidth & overlap).
    • Outputs: delta_psd, pass.
    • Idempotency: bound to data fingerprints and window config.
    • Exception: E_SCHEMA_MISMATCH.
    • Note: delta_psd = ( ∫ | S_xx(f) - S_yy(f) | df ) / ( ∫ S_xx(f) df ).
  8. I30-8 collect_ts_metrics(run_id:str, fields:list) -> dict
    • Inputs: run_id, fields ⊆ TS.*.
    • Output: { field -> series }.
    • Idempotency: bound to run_id and time window.
    • Exception: E_DATA_MISMATCH.
  9. I30-9 publish_release(anchor:str, channel:str, policy:dict) -> dict
    • Inputs: anchor (EnvLock || PipelineCard || ParamCard joint hash), channel ∈ {canary, stable, LTS}, policy (gates & monitoring).
    • Output: { release_id:str, sig_k:bytes }.
    • Idempotency: bound to anchor and channel.
    • Exception: E_ENV_DRIFT.
  10. I30-10 plan_migration(diff:dict) -> MigPlan
    • Inputs: diff (difference matrix for PipelineCard/ParamCard).
    • Output: MigPlan (W_mig, T_dep, T_grace, rollback anchor).
    • Idempotency: bound to diff fingerprint.
    • Exception: E_SCHEMA_MISMATCH.
  11. I30-11 execute_cutover(plan:MigPlan) -> CutoverReport
    • Input: MigPlan.
    • Output: CutoverReport (dual-run comparison, score deltas, TS.* impacts).
    • Idempotency: bound to plan and window.
    • Exceptions: E_ENV_DRIFT, E_TIMEBASE_SKEW.
  12. I30-12 rollback(anchor:str, reason:str) -> RollbackReport
    • Inputs: anchor, reason.
    • Output: RollbackReport (restore point, impact surface, ScoreSummary(old,new)).
    • Idempotency: bound to anchor and reason.
    • Exception: E_DATA_MISMATCH.

V. Idempotency and Replay (Unified Contract)

  1. Idempotency key: idemp_key = hash( name || version || inputs || EnvLock ). For any I30-*, if idemp_key matches, then
    • fingerprint(outputs_new) = fingerprint(outputs_old).
    • Timestamp variations are allowed but excluded from the fingerprint domain.
  2. Randomness: prototypes involving sampling must accept seed; if not provided, reject with E_SEED_INVALID.
  3. Time base: inputs with time must first call I30-6 to obtain alpha, beta, map internal tau_mono to common ts, and only then compute spectral and scoring metrics.

VI. Metrology and Observability Interfaces

  1. Required TS.* fields
    • TS.latency.{p50,p95,p99}, TS.thrpt, TS.error_rate, TS.cpu, TS.mem, TS.gpu.util (if applicable), TS.hb.
    • For I30-3/4/7, add TS.psd.band_energy; for I30-6, add TS.timebase.r_tb.
  2. Sampling & aggregation windows
    Slice uniformly on external ts; window length, stride, and alignment policy are declared in PipelineCard.

VII. Exception Set and Handling

  1. Core exceptions
    • E_ENV_DRIFT: environment differs from EnvLock.
    • E_DATA_MISMATCH: inputs or schema do not match PipelineCard/ParamCard.
    • E_TIMEBASE_SKEW: time base misfit, r_tb beyond gate.
    • E_NONDETERMINISM: nondeterminism detected—recomputed output fingerprint differs.
    • E_SEED_INVALID: missing or out-of-domain seed.
    • E_SCHEMA_MISMATCH: structural/field mismatch.
  2. Handling (minimal set)
    Record H_k/sig_k and register anchor; back-fill TS.* and delta summaries; for run-time exceptions, trigger I30-12 rollback with ScoreSummary(old,new).

VIII. Reference Fragments (Pseudocode & State Machines)

inputs: trace.tau_mono[], reference.ts[]

preprocess: handle missing/outliers

solve: ts ≈ alpha + beta * tau_mono (robust LS)

compute: r_tb = norm(ts - (alpha + beta * tau_mono)) / norm(ts)

guard: if r_tb > tau_tb -> E_TIMEBASE_SKEW

emit: {alpha, beta, fit:{r_tb, residuals}}; TS.timebase.r_tb <- r_tb

INIT : validate EnvLock & PipelineCard

PREP : map time base to common ts; lock seed & rng_family

EXEC : run cases; collect TS.* and intermediate fingerprints

ANALYZE: compute delta_rep, delta_psd, partial scores

DECIDE : compare to gates; set gate.rep

FINAL : assemble BenchReport; append audit signature sig_k


IX. Cross-References and Dependencies


X. Versioning and Numbering Strategy


Copyright & License (CC BY 4.0)

Copyright: Unless otherwise noted, the copyright of “Energy Filament Theory” (text, charts, illustrations, symbols, and formulas) belongs to the author “Guanglin Tu”.
License: This work is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0). You may copy, redistribute, excerpt, adapt, and share for commercial or non‑commercial purposes with proper attribution.
Suggested attribution: Author: “Guanglin Tu”; Work: “Energy Filament Theory”; Source: energyfilament.org; License: CC BY 4.0.

First published: 2025-11-11|Current version:v5.1
License link:https://creativecommons.org/licenses/by/4.0/