Harden core runtime contracts - #208
Draft
wangxiao1254 wants to merge 7 commits into
Draft
wangxiao1254 wants to merge 7 commits into
wangxiao1254 wants to merge 7 commits into
Conversation
Accept byte-bool buffers in bit packing, PRG output, packed IOChannel transfers, F2k selectors, and Galois-field packing without casting them to bool pointers. Share implementations with the existing bool overloads. Preserve null-safe zero-length calls, normalize byte-bool output, and keep the bool and uint8_t paths bit-, wire-, and PRG-state-equivalent.
Expose explicit send and receive socket-buffer sizes through NetIO and TLSConfig. Apply them before listen/connect and the TLS handshake, propagate them to NetIO siblings, and leave operating-system defaults unchanged when both values are zero. Provide an opt-in bandwidth/RTT helper that rounds the bandwidth-delay product to a power-of-two tier and reject explicit sizes the kernel cannot provide.
Remove the transport-level sync hook and preserve connection coverage with explicit protocol round trips. Callers that need a peer barrier must exchange a protocol message; flush only drains local output. Fail on NetIO stdio flush errors. Make TraceIO reject null transports, flush its trace before the wrapped channel, create trace files with mode 0600, and report trace write and flush failures.
Flush fatal diagnostics before terminating. Require exact deterministic-test activation, reserve lane zero for the owner thread, derive child lanes deterministically, and reject invalid lane and ThreadPool configurations. Add focused fail-stop, deterministic threading, and pool-lifecycle coverage.
Accept null pointers only when a block-array operation has length zero and reject negative lengths before pointer arithmetic. Add direct zero-length and invalid-length coverage.
Strictly parse party and port inputs, preserve the steady-clock type through timing helpers, and validate bit-packing lengths. Fix the portable SIMD include bootstrap and handle every remainder row in the scalar transpose tail. Add independent scalar-reference and utility boundary tests.
Drain every future before rethrowing the first task failure, preserve exception-disabled builds, and remove unused generic macros from the public umbrella. Make ThreadPool construction exception-safe, derive result types from the stored invocation category, and retain move-only task support. Add direct BlockVec ownership and alignment coverage.
wangxiao1254
force-pushed
the
audit/core-contracts
branch
from
August 22, 2026 13:47
05e630f to
f32f40c
Compare
wangxiao1254
force-pushed
the
fix/wan-socket-policy
branch
2 times, most recently
from
August 23, 2026 02:45
3c84449 to
030bf9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tighten fail-stop, deterministic-test, utility, transpose, task-lifecycle, and aligned-storage contracts in the runtime core.
Changes
EMP_PORT;steady_clockconsistently for elapsed timing;BlockVecalignment, copy/move, reserve, and lifetime coverage.Compatibility and cost
The runtime remains exception-free at its public boundary and continues to build with
-fno-exceptions. Task exceptions, where enabled internally throughstd::future, are rethrown only after the whole submitted batch is drained.No protocol wire format changes. The checks are construction, parsing, failure, or batch-boundary checks; gate and crypto loops are unchanged.
Tests
test_block,test_block_vector,test_error,test_test_mode,test_thread_pool,test_utils, andtest_no_exceptions);EMP_TOOL_NATIVE_ARCH=OFF): focused suite 7/7 passed.Focused coverage includes block helpers, BlockVec, error handling, deterministic test-mode threading, ThreadPool, utilities, transpose reference comparisons, and the exception-disabled umbrella build.
Stack
This is PR 3 of 6 and targets
fix/wan-socket-policy.