CREXX

REXX Language implementation

View the Project on GitHub adesutherland/CREXX

RCC-5 mathematics validation strategy

Status: implemented. RCC-5B float coverage and RCC-5C integer/decimal coverage meet the focused completion gates below.

Approved by Adrian: 2026-08-20.

Purpose

This strategy defines the evidence required to show that the Level G rxfloat, rxint, and rxdecimal mathematics surfaces implement their public contracts. It deliberately separates three concerns:

  1. tests/support/numeric_test_support.crexx supplies typed assertions and reports comparison failures. It is test machinery, not an oracle.
  2. Each contract suite owns its inputs, independently derived expected values, tolerances, signal expectations, and public-surface calls.
  3. This document owns the risk model, required scenarios, execution matrix, oracle provenance, and completion criteria.

The float provider delegates mathematical implementation to the host C maths library. Its main cREXX risks are binding, signature, compatibility, provider loading, and promised edge behaviour. The integer and decimal algorithms are implemented by cREXX itself. They therefore need materially deeper algorithm, boundary, and numerical coverage.

Shared assertion tool

The test-only numerictestsupport namespace provides explicit typed checks:

Integer results are exact. Float and approximate decimal cases state both absolute and relative tolerances explicitly; zero is valid for either. Decimal comparisons inherit the suite’s numeric context. The support module contains no function-specific expected result and must never import rxfloat, rxint, or rxdecimal.

The module is compiled, assembled, linked, and executed through the normal toolchain beside each owning suite. It is not installed as a product library.

Expected-value independence and provenance

Expected results must not be calculated at runtime by the function under test or by another cREXX routine sharing the same algorithm. Inverse and identity checks are useful secondary properties, but cannot be the only oracle because correlated errors can cancel.

Any generated fixture must record the generator implementation and version, precision and rounding mode, exact command, and a content checksum. Generated fixtures are reviewed and checked in; the test run has no external package or network dependency. Particularly important decimal and integer boundary cases should be corroborated by a second independent implementation or exact mathematical derivation.

Common contract coverage

Every public procedure requires:

The suites must consume the public namespaces and normal RXBIN dependencies. They must pass through rxc, rxas, rxlink, and rxvm; direct calls to a C helper do not prove the library contract. Expected signals must verify both the signal category and the operation that raised it.

Binary-float contract: rxfloat

lib/plugins/float/rxfloat_test.crexx is the focused RCC-5B black-box contract suite. The host C maths library is mature, so this suite validates the cREXX surface and representative numerical behaviour rather than attempting to requalify every host libm implementation exhaustively.

Required coverage is:

The source-surface guard requires every registered canonical procedure to have both an expected-value call and a compatibility-alias comparison. This focused contract coverage completes RCC-5B without claiming exhaustive libm accuracy.

Exact-integer contract: rxint

rxint has moderate algorithmic risk and high boundary/overflow risk. All results are exact; tolerances are prohibited.

gcd

lcm

isqrt

powmod

factorial

Decimal contract: rxdecimal

rxdecimal has the highest risk because cREXX owns the iterative algorithms, range reduction, termination, work-context selection, and final rounding. The primary oracle is independent high-precision data, not float conversion and not an inverse call through another rxdecimal function.

All public procedures are tested at caller precisions 9, 18, 32, 64, 65, 96, 97, and 128. The fixed work-context switching boundaries additionally require cases at 10, 19, and 33 digits. The 65 cell crosses the former assurance boundary, 96/97 cross the former widest work tier, and 128 is the documented qualification boundary rather than a runtime maximum. Expected values are supplied as decimal strings so they never pass through binary float.

Constants and context

sqrt

exp

ln

sin and cos

Every iterative decimal routine must also have a bounded non-convergence or range failure test where that failure is part of its public contract. A hang or silent low-precision result is never an acceptable outcome.

Suite layout and completion gates

RCC-5C is complete only when the integer and decimal scenario sets above pass in the four optimized/no-opt and concrete-VM cells, their independent fixture provenance is retained, and every exported procedure is structurally covered. The one consolidated broad CTest/sanitizer/install closeout remains an end-of-RCC-5 activity; this strategy does not require rerunning it after each focused test increment.

RCC-5C met this gate on 2026-08-20: all eight contract execution cells and the structural guard passed (10/10 including the shared artifact fixture). After a complete Debug rebuild, the requested broad review run passed 2,302/2,302 CTest cases. RCC-5D and RCC-5E subsequently split statistics and the remaining historical native bundles. Their focused contract, concurrency, automatic-load, install and native-package coverage is maintained alongside this mathematics suite; the one post-acceptance broad closeout is recorded in the RCC-5 worklist rather than repeated per subphase.

The accepted caller-relative precision follow-up removed the fixed 64-digit assurance ceiling without adding another runtime ceiling. Its independent constant, root, exponential, logarithmic, trigonometric, large-angle, and caller-context cells qualify all seven exports through 128 digits while retaining the original 9-through-64 regression matrix. Final qualification passes focused Debug and Apple-ASan 5/5, complete Debug and profiling-off Release 2,302/2,302, and scratch-installed bytecode/native 128-digit smokes. The formerly blocking RXAS SSA use-after-free and the independently retained wide-decimal buffer defect now have permanent regressions and repaired Apple- ASan proof. Adrian approved RCC-5 publication with supported Linux ASan/LSan assigned to RCC-8 release QA under live SAN-001 and SAN-002. This strategy does not relabel the Apple-only pass as complete cross-platform sanitizer closure or remove the later release-blocking gate.