Fail-closed N/M QML numeric core
Use versioned training, loss, SPSA, and adjoint contracts with finite inputs, exact evaluation accounting, deterministic surface parity, and explicit numerical failure codes.
QML numeric core 0.1 contracts
Training, binary losses, SPSA, adjoint gradients, and QNG expose separate versioned contracts. Invalid public API inputs fail before circuit execution or parameter mutation, while valid legacy numeric calls retain their existing results.
Finite-input policy
NaN, Infinity, out-of-range predictions or labels, invalid gain schedules, unknown parameters, and non-finite state or optimizer updates return stable fail-closed evidence.
Exact evaluation accounting
SPSA uses exactly two objective evaluations per step independent of parameter count. The maximum 100-step contract therefore records exactly 200 circuit evaluations.
Core, CLI, and Worker parity
One seeded N/M source produces identical cost history, final parameters, and gradient method through installed Core, CLI JSON, and the runtime Worker used by Quantum AI Studio.
Worker cancellation boundary
Browser cancellation sends train-cancel, terminates the active worker, rejects the pending result with NMRuntimeCancelledError, and prevents stale completion from mutating the UI.
Explicit metric regularization
QNG records the raw fidelity metric, its regularized diagonal, condition number, singular parameters, and exact evaluation count. Defaults use shift 0.01 and Tikhonov floor 0.001; callers may reject singular metrics instead.
Frozen local workload limits
Stable numeric diagnostics
Training, loss, SPSA, adjoint, and QNG failures use distinct input, evaluation, singularity, and invariant codes rather than relying on localized error prose.
NM-QML-TRAIN-001NM-QML-TRAIN-002NM-QML-TRAIN-003NM-QML-TRAIN-004NM-QML-TRAIN-005NM-QML-TRAIN-006NM-QML-LOSS-001NM-QML-LOSS-002NM-QML-LOSS-003NM-QML-SPSA-001NM-QML-SPSA-002NM-QML-SPSA-003NM-QML-SPSA-004NM-QML-SPSA-005NM-QML-ADJOINT-001NM-QML-ADJOINT-002NM-QML-ADJOINT-003NM-QNG-001NM-QNG-002NM-QNG-003NM-QNG-004A deterministic local optimizer does not guarantee convergence, generalization, quantum advantage, or hardware fidelity. Dataset split/version, model migration, and remote Windows/Linux performance gates remain separate promotion requirements.
Analytic loss tables and finite differences, seeded SPSA, adjoint/parameter-shift cross-checks, hostile numeric inputs, exact Core/CLI/Worker parity, clean tarball consumption, and separate 100,000-loss plus eight-parameter/100-step QNG performance ratchets are automated.