WIP: feat: Add current-locale multibyte conversion #88

Draft
erikinkinen wants to merge 43 commits from feature/current-locale-multibyte into feature/native-c-owner-input-cohort
Owner

Add conventional multibyte signatures over the existing conversion core. Zero-initialized states follow current LC_CTYPE, NULL state uses function-private thread cells, and string size queries preserve the exact original state and cursor. Existing explicit-state EriX interfaces keep their separate contracts.

  • Conversion entries, state preparation and C declarations.
  • Compose the genuine locale and thread-state providers.
  • Integrate native producer inputs, the C workload and manual/API references.
  • Complete native lifecycle and guest acceptance.

Builds on #84. Design and dependencies: #87, #85, #86.

This branch also includes the completed downstream features from #91.

Add conventional multibyte signatures over the existing conversion core. Zero-initialized states follow current LC_CTYPE, NULL state uses function-private thread cells, and string size queries preserve the exact original state and cursor. Existing explicit-state EriX interfaces keep their separate contracts. - [x] Conversion entries, state preparation and C declarations. - [x] Compose the genuine locale and thread-state providers. - [ ] Integrate native producer inputs, the C workload and manual/API references. - [ ] Complete native lifecycle and guest acceptance. Builds on [#84](https://git.erikinkinen.fi/erix/lib-cstd/pulls/84). Design and dependencies: [#87](https://git.erikinkinen.fi/erix/lib-cstd/issues/87), [#85](https://git.erikinkinen.fi/erix/lib-cstd/issues/85), [#86](https://git.erikinkinen.fi/erix/lib-cstd/issues/86). This branch also includes the completed downstream features from #91.
erikinkinen added this to the Alpha 1 milestone 2026-11-08 12:37:16 +01:00
feat: Add current-locale multibyte conversion entries
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 9s
CI / thread (push) Successful in 2m29s
CI / memory (push) Has been cancelled
9f2b02aef3
Reuse the checked conversion core for conventional signatures while requiring original locale and per-thread state providers. Keep query-only state bytes unchanged, retain pending prefixes across calls, and keep implicit state separate for every function without a host or process-global fallback.
test: Add a conventional multibyte C workload
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 24s
CI / thread (push) Successful in 2m25s
CI / memory (push) Has been cancelled
a42019ae6d
Exercise the current-locale signatures with caller-selected C and UTF-8 modes, independent function-private prefixes, exact query-state preservation and original errno. Keep error controls in explicit state so one negative case cannot poison a later implicit-state observation.
feat: Retain original per-thread runtime state and destructor duties
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 11s
CI / thread (push) Successful in 2m25s
CI / memory (push) Failing after 4m12s
fc0df4140f
Keep mutable locale, conversion and key values in actual process-heap-backed thread registrations. Retain exposed storage and callback acquisitions independently of wrapper lifetime so abandoned or failed teardown cannot fabricate native retirement. Preserve the legacy profile while preparing explicit extended native entry integration.
Bring the signed process-heap-backed thread runtime into the conventional conversion branch. Keep its allocation, registration, callback and retirement work in the prerequisite history while conversion code consumes the same function-state ABI.
feat: Bind extended thread headers to original allocated state
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / memory (push) Failing after 2m5s
CI / markdown (push) Failing after 10s
CI / thread (push) Successful in 2m18s
4375bb5847
Consume the shared dependency-free thread image package instead of duplicating layout definitions. Preflight the original caller TCB before publishing the actual state pointer and preserve its registration before any native Start can consume that pointer.
Use the thread-runtime ABI enumeration directly so conventional conversion and native state production cannot maintain conflicting function-to-cell mappings.
build: Compose the shared thread-runtime ABI
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / memory (push) Failing after 2m20s
CI / markdown (push) Failing after 24s
CI / thread (push) Successful in 2m36s
868ce1b826
Use the signed provider revision that shares native layout records with LibIPC and exposes additional-thread state through its actual allocation owner. Preserve the provider branch as the prerequisite rather than copying its ABI implementation into conversion code.
Define checked category and environment selections with original heap-owned locale objects and independent thread selection. Reuse the existing process publication for the coordinated runtime-state provider instead of adding a hidden thread table or host locale fallback.
Keep locale selection in the actual process-owned thread state and preserve its allocation, entry and retirement contracts. This brings the typed current-state interface into the same source tree without duplicating its ownership implementation.
Use the dependency-free shared thread image contract while preserving the existing Cstd reexport path and original process-owned runtime implementation.
feat: Retain thread cleanup through original native self-exit
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 22s
CI / memory (push) Failing after 2m18s
CI / thread (push) Successful in 2m19s
b9b9e57753
Complete registered key callbacks before the current-only native exit bridge and preserve returned status failures on the original state. Pass the exact last-thread finalization duty back to the process root instead of treating local cleanup as proof of native departure or backing reuse.
feat: Export process and thread locale interfaces
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 7s
CI / memory (push) Failing after 2m9s
CI / thread (push) Successful in 2m20s
0426df500b
Project locale operations through the original process binding and retain locale allocations in its existing heap. Conventional locale, ctype and langinfo calls use checked per-thread selection without host databases or a second runtime root. Retain explicit native enrollment and guest acceptance as pending integration gates.
test: Exercise locale allocation failure on the original heap
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 12s
CI / memory (push) Failing after 1m57s
CI / thread (push) Successful in 2m22s
25b52e0435
Exhaust the same retained process heap before creating a new locale, then verify the existing object remains unchanged and every actual allocation is released.
Retain the provider branch implementation of current-thread destructor completion and the original native departure result. Keep local conversion completion separate from actual thread retirement and final process cleanup.
ci: Select the actual extended thread runtime companions
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 8s
CI / memory (push) Failing after 2m0s
CI / thread (push) Successful in 2m18s
6ab3f8d7c2
Resolve the shared runtime ABI and compatible producer branches once per run through the common source protocol. Keep public dependencies on main and preserve existing Cargo gates while retaining frozen source evidence for the selected feature cohort.
Use the signed same-heap locale implementation and its sole process binding for current encoding and thread selection. Preserve the separate provider history and native enrollment requirements rather than introducing a conversion-local locale owner.
test: Add a conventional locale C workload
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 10s
CI / memory (push) Failing after 2m21s
CI / thread (push) Successful in 2m21s
3270ebee75
Exercise all conventional character signatures and explicit locale objects through the original process interface. The probe requires genuine initialized state and returns observations without supplying a host fallback or asserting native acceptance.
fix: Publish complete thread failures before reentrant observation
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 19s
CI / memory (push) Failing after 2m10s
CI / thread (push) Successful in 2m17s
caa78c7d18
Refuse reentry while the original registration publishes its first error and expose the full cause only after the sole write ends. Recheck conversion admission after the user borrow returns so a failure cannot be reported as ordinary success. Keep the canonical state layout and original cleanup duties unchanged.
Select the published native-thread provider cohort through Integration so canonical main dependencies resolve the new ABI package during development. Keep source selection centralized and preserve the existing crate gates.
Preserve the provider implementation that publishes a complete first failure before signal-safe readers can observe it. Retain the original wide error and callback duties without changing native state layout.
build: Compose the complete conventional locale C probe
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 14s
CI / memory (push) Failing after 2m30s
CI / thread (push) Successful in 2m40s
4e4d1d1878
Retain the locale provider error-atomicity controls and its original C consumer alongside current-locale multibyte conversion. Native entry and producer enrollment remain explicit source obligations.
Author
Owner

The conversion branch now includes the original thread-state and locale providers from #89 and #90. NULL-state conversion uses the same process runtime and per-thread storage. Native producer execution, upstream semantic mapping and guest acceptance remain open.

The conversion branch now includes the original thread-state and locale providers from #89 and #90. NULL-state conversion uses the same process runtime and per-thread storage. Native producer execution, upstream semantic mapping and guest acceptance remain open.
Separate actual Rust and LLVM call paths from declarations, tests and conditional sanitizer consumers. Record the missing C++ runtime sources and EriX target configuration so the conversion subset cannot be mistaken for complete toolchain support.
docs: Compose the upstream multibyte interface mapping
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 17s
CI / memory (push) Failing after 2m49s
CI / thread (push) Successful in 2m38s
85e1e9b298
Distinguish actual selected calls from declarations and conditional consumers. Record target state-layout incompatibilities and the missing C++ runtime input and configuration before claiming toolchain coverage.
fix: Admit the genuine seven-member C runtime workspace
Some checks failed
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 10s
CI / memory (push) Failing after 2m34s
CI / thread (push) Successful in 2m39s
a55ae0b1b0
Retain the original thread runtime as an explicit seventh local package before the maintained Cargo matrix. Validate actual captured Cargo metadata and preserve missing, extra and foreign-path refusals; update exact feature and helper-cohort controls for the already selected source variants without accepting arbitrary dependencies or weakening source ownership.
Expose the implemented conversion subset through wchar.h and uchar.h with one shared declaration and state layout. Enforce the signed wide scalar and unsigned wide EOF ABI, preserve native thread and locale lifetime requirements, and retain explicit gaps for unimplemented wide-library and runtime configuration inputs.
Require the C aliases to match the selected least-width integer types and retain exact scalar alignment. Include the compiler integer header before the conversion headers so existing standard limit macros cannot hide an incompatible declaration.
Prepare the existing original Cargo source operation before full-crate direct Rust witnesses and retain its actual thread-runtime ABI library through their consumers. Keep the same complete Cargo matrix and explicit source selections; the standalone conversion checker acquires its own bounded operation from that snapshot.

(cherry picked from commit 4f5fef77d0)
Bind code and nonlinkable metadata files to the actual Cargo artifact and original producer before capture. Check and independently retire all original outputs without deriving companion paths or calling replaced receivers.

(cherry picked from commit 34e14f1037)
Register the original capture attempt before opening a reported Cargo output. An unreturned acquisition cannot be retired as an empty receiver or reopened by a later attempt.

(cherry picked from commit c0b3c9d88a)
Bind every output receiver to the original completed artifact selection and journal position before its initializer or file effects. Refuse path-only construction, repeated initialization and changed original registrations while retaining original close duties.

(cherry picked from commit 84121510d0)
Reject a replaced library selector before a consumer command or callback, even when the original output roster remains intact. Cleanup observes only the original journal before draining its original receivers.

(cherry picked from commit 984fe39d53)
Provide each originally reported code and metadata file as an explicit extern path. Compilers whose archives contain metadata stubs then receive the actual full metadata from the same retained production, without inferred files or changed embedding options.

(cherry picked from commit 515ea2cfbe)
Check original self registration before latching an observation failure or draining produced files. Copied dependency and output views cannot poison or close their actual original producer.

(cherry picked from commit 2c0c1de7e1)
Route thematic full-crate callers through the same original dependency owner as their library. Keep the actual extern metadata, dependency directory and fresh output checks throughout each compiler call so transitive crate loading does not fall back to an unowned lookup.

(cherry picked from commit 3420f7bf9b)
Match the intrinsic expected length directly when selecting the short-copy capacity. The debug callback must preserve its unchanged known and unknown error assertions without acquiring an out-of-line core slice-method dependency.

(cherry picked from commit fc2f4828da)
(cherry picked from commit 676f56d1a1)
Keep the saved compiler command subordinate to the original retained output lifetime. Document the shared dependency boundary and check that a withdrawn receiver refuses before source verification or native invocation.

(cherry picked from commit 0e4a1882d1)
Keep exact dependency and feature equality for this runtime: the inert thread dependency and current-locale edge already exist, while later string activation modes remain outside this feature.
Keep intentional Linux SIGILL controls from publishing uncontrolled core output. Change only each declared crash child, assert its actual limit and dumpability policy, and preserve the parent signal and generated-source closure requirements.

(cherry picked from commit d46538f25f)
(cherry picked from commit 1ee3b7b1c7)
Keep the existing acquisition orderings and update closures while using the renamed standard-library API. Identifier allocation and join-state claims retain their original exhaustion and once-only behavior without deprecated method warnings.

(cherry picked from commit a233f694aa)
Use the same standard-library rename for startup binding counts and locale references. Preserve the existing orderings, overflow limits and refusal closures.

(cherry picked from commit fbe840291f)
Express the seven rejected literal byte arrays as equivalent fixed byte strings, preserving every malformed-directory case and its exact expected bytes without suppressing Clippy.

(cherry picked from commit c2a2cd5eb6)
fix: Keep checked atomic admission compatible with stable Rust
All checks were successful
CI / thread (push) Successful in 1m11s
CI / markdown (push) Successful in 3s
CI / memory (push) Successful in 11m50s
d4324a1392
Use compare-exchange loops for generation, borrow, lease and locale reader admission. Preserve the original success and failure orderings, old-value result and overflow refusal without requiring the unstable atomic_try_update API.
feat: Merge provide standard multibyte conversion headers
All checks were successful
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / thread (push) Successful in 1m7s
CI / memory (push) Successful in 11m20s
8c78744ca9
Integrate the reviewed prepared history into feature/current-locale-multibyte. The feature tree and
original source branch remain unchanged. Upstream work retains its own
completion requirements.

#91
Author
Owner

Merged the approved downstream work from #91. The upstream PR retains its own remaining scope and completion requirements.

Merged the approved downstream work from #91. The upstream PR retains its own remaining scope and completion requirements.
All checks were successful
CI / memory (pull_request) Has been skipped
CI / thread (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / thread (push) Successful in 1m7s
CI / memory (push) Successful in 11m20s
This pull request has changes conflicting with the target branch.
  • docs/runtime-owner-cohort.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'feature/current-locale-multibyte:feature/current-locale-multibyte'
git switch 'feature/current-locale-multibyte'

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.

git switch 'feature/native-c-owner-input-cohort'
git merge --no-ff 'feature/current-locale-multibyte'
git switch 'feature/current-locale-multibyte'
git rebase 'feature/native-c-owner-input-cohort'
git switch 'feature/native-c-owner-input-cohort'
git merge --ff-only 'feature/current-locale-multibyte'
git switch 'feature/current-locale-multibyte'
git rebase 'feature/native-c-owner-input-cohort'
git switch 'feature/native-c-owner-input-cohort'
git merge --no-ff 'feature/current-locale-multibyte'
git switch 'feature/native-c-owner-input-cohort'
git merge --squash 'feature/current-locale-multibyte'
git switch 'feature/native-c-owner-input-cohort'
git merge --ff-only 'feature/current-locale-multibyte'
git switch 'feature/native-c-owner-input-cohort'
git merge 'feature/current-locale-multibyte'
git push origin 'feature/native-c-owner-input-cohort'
Sign in to join this conversation.
No description provided.