WIP: Implement freestanding C memory and string primitives #3
No reviewers
Labels
No labels
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/lib-cstd!3
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/posix-compat"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary and rationale
Provide eighteen freestanding C byte and string operations through documented Rust declarations, partial C headers and one explicitly selected assembler companion. Add
strnlen, which stops at the first NUL or the caller's full-width bound. Preserve all seventeen preceding function bodies.Tracking and scope
bdcbbea43550e8b99cd9a8221e4bc5a645637990onfeature/posix-compat.no_stdRust interface. Startup, allocation, errno storage, remaining functions, POSIX adapters and full guest builds remain open.e2b1cf5995bcf6334839cda9a013e90fa97787d5.Architecture, authority and failure behavior
For a positive bound,
strnlenrequires initialized readable bytes through the first NUL or the complete bound, whichever comes first. It returns that NUL's index or the bound. No byte at the bound or after NUL is read, and the source cursor is not advanced after the last permitted byte. Count and return value retain the full 64-bit width. Only the namespaced raw zero-count interface expressly permits null; conventional C pointer rules remain applicable.The scalar leaf uses no stack scratch, allocation, syscall, errno access or shared state. It obtains no capabilities and retains no pointer. The returned count grants no memory access. Review removed a redundant loop comparison while preserving the pre-read and exhausted-bound checks; no measured speedup is claimed.
Core/public/hidden policies share the same eighteen bodies. The query section is 178 bytes and preserves the original 152-byte prefix; the 234-byte memory, 136-byte writer and 344-byte span sections remain exact. Eight assembler source roles include zero-instruction alias files under every policy. Consumers must explicitly select the new revision and bytes. Missing or duplicate companions fail linkage. Receipts bind selected inputs without establishing repository provenance or the complete installed compiler closure.
Validation evidence
Matching Docs
7ccbe0bfa83ce5942878fb7cf8c57bb1abe75d00is signed and pushed in Docs PR #4. Its original-source references select ABI 2417b283 and eighteen-function libcbdcbbea, with 161 and twenty API routes respectively. All 44 documentation tests, both API checks and 55 Markdown files pass. The complete 2,339-page manual passes in 154.64 seconds with zero final warnings; all 425,255 word boxes fit and nine actual previews pass visual review. The first render was interrupted by an outer watchdog that could not observe the inner log; its failed statuses and clean cleanup are retained. The corrected outer budget preserves the inner hard/progress limits, and passing API/unit checks were reused. Matching Docs push CI 837 and PR CI 838 both pass for signed7ccbe0bfa83ce5942878fb7cf8c57bb1abe75d00, ending by 05:58:35 UTC on September 14. All four complete logs total 752,104 bytes and are correlated with the original workflow and build/publish scripts. Each manual job passes 44 tests and finishes at 2,339 pages with zero final-pass warnings; thirty first-pass and one second-pass convergence warnings resolve. Each Markdown job checks 55 files with zero errors. The logged CI PDF size is 4,105,617 bytes; CI artifact bytes and geometry were not independently inspected. Local layout and visual evidence remain separate. This adds no native metadata operation, companion migration or complete guest build result.Selected Rust 1.97.1 formatting, strict Clippy, warning-denied host/freestanding builds and private rustdoc pass. Each default/all-feature debug/release host invocation passes 33 Rust tests, for 132 executions. The feature set contains only empty
default; those commands have identical effective features. Rust crate roots deny missing documentation.All 90 independent array cases, 23 producer controls and twelve mixed C/Rust programs pass. New witnesses cover all byte values, alignments, exact nonterminated bounds, read-only protected-page edges, early NUL and real callbacks with pointer/count arguments after six scalar register arguments. Large bounds over short terminated strings test argument width, not returned lengths above 2^32. Existing register, direction-flag and guarded-stack checks remain. Forty intentional link rejections cover missing, duplicate and older companions; the isolated old-seventeen control requires exactly the two new
strnlensymbol names, preserving the earlier writer/span controls.All recorded object/archive outputs and original instruction witnesses correlate. Nine Markdown files, workflow shell syntax, canonical documents, source consistency, whitespace and code-size checks pass. The runtime matrix and dependent finishing checks complete without an unexpected failure or warning. A later ROADMAP-only result update receives the affected documentation/source checks without runtime replay.
Push CI 11 and PR CI 12 both pass for signed
bdcbbea, ending by 05:40:42 UTC on September 13. All four complete logs are retained (64,532 bytes), with no compiler or lint warnings. Each runtime job completes the source-bound checker with 211 main commands, twelve host programs and forty intended link controls, including all four new length programs and four old-seventeen controls. The separate nested CI case counts and artifact bytes were not retrieved; the detailed Rust/array/producer totals remain local results. Each Markdown job checks nine files with zero errors. Preceding push CI 9 and PR CI 10 pass only for seventeen-function source4207509c862c6a42b79ccb06e0b01ef61e4727b2.Matching eighteen-function API/manual updates are in progress in Docs PR #4. Signed Docs
928ff81a1d6dea09145f49fd4fbe07ab84525000, its nineteen API routes, complete 2,331-page manual and passing CI 833/834 remain evidence for the preceding seventeen-function interface.Integration PR #12 still selects memory-only source
8270170c221260c444d923865461231e6ce622b2for native links. This checkpoint does not establish guest execution of these new routines, full libc or a complete build of EriX within EriX.Review checklist
erikinkinen referenced this pull request from erix/integration2026-09-12 23:47:08 +02:00
erikinkinen referenced this pull request from erix/docs2026-09-13 00:15:30 +02:00
WIP: Provide an explicit freestanding C memory runtimeto WIP: Provide explicit freestanding C memory and query routinesWIP: Provide explicit freestanding C memory and query routinesto WIP: Implement freestanding C memory and string primitivesView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.