WIP: feat: Add process and thread locale interfaces #90

Draft
erikinkinen wants to merge 14 commits from feature/process-thread-locales into feature/native-c-owner-input-cohort
Owner

Provide conventional ctype, locale and langinfo interfaces over the original ProcessRuntime, its heap and genuine per-thread state. C/POSIX and UTF-8 profiles support independent categories, original environment precedence and explicit unsupported-name errors. Locale handles identify actual retained allocations; read-only lookups remain usable during an interrupted writer and free waits for existing readers.

  • Implement source interfaces, headers and same-root binding.
  • Cover parsing, failure atomicity, real reader/free and signal reentry, thread selection and foreign-runtime refusal.
  • Enroll original native producers and the C workload.
  • Complete upstream applicability, manual/API generation and native/guest acceptance.

Host source-equivalent controls: 35 core tests and 44 startup tests pass; strict startup Clippy passes on host and x86_64-unknown-none, warning-denied private rustdoc and C/C++ header checks pass. These are source controls, not guest acceptance.

Design: #86. Builds on #84 and normally composes the genuine #89 thread runtime. The separate multibyte consumer remains independent.

Provide conventional ctype, locale and langinfo interfaces over the original ProcessRuntime, its heap and genuine per-thread state. C/POSIX and UTF-8 profiles support independent categories, original environment precedence and explicit unsupported-name errors. Locale handles identify actual retained allocations; read-only lookups remain usable during an interrupted writer and free waits for existing readers. - [x] Implement source interfaces, headers and same-root binding. - [x] Cover parsing, failure atomicity, real reader/free and signal reentry, thread selection and foreign-runtime refusal. - [ ] Enroll original native producers and the C workload. - [ ] Complete upstream applicability, manual/API generation and native/guest acceptance. Host source-equivalent controls: 35 core tests and 44 startup tests pass; strict startup Clippy passes on host and x86_64-unknown-none, warning-denied private rustdoc and C/C++ header checks pass. These are source controls, not guest acceptance. Design: [#86](https://git.erikinkinen.fi/erix/lib-cstd/issues/86). Builds on [#84](https://git.erikinkinen.fi/erix/lib-cstd/pulls/84) and normally composes the genuine [#89 thread runtime](https://git.erikinkinen.fi/erix/lib-cstd/pulls/89). The separate multibyte consumer remains independent.
erikinkinen added this to the Alpha 1 milestone 2026-11-08 13:31:42 +01:00
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.
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.
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 dependency-free shared thread image contract while preserving the existing Cstd reexport path and original process-owned runtime implementation.
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.
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.
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.
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.
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.
build: Compose original thread failure and CI contracts
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 2m12s
CI / thread (push) Successful in 2m17s
d780468f0c
Retain the coordinated thread provider hardening and shared source-profile selection in the locale provider branch without depending on its multibyte consumer.
docs: Wrap thread and command owner contracts
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 13s
CI / memory (push) Failing after 2m15s
CI / thread (push) Successful in 2m28s
4fb44c5dd1
Keep the shared layout and command lifetime descriptions within the documentation line limit without changing their contracts.
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 8s
CI / memory (push) Failing after 2m15s
CI / thread (push) Successful in 2m27s
98f98dd9a0
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.
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 8s
CI / memory (push) Failing after 2m15s
CI / thread (push) Successful in 2m27s
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/process-thread-locales:feature/process-thread-locales'
git switch 'feature/process-thread-locales'

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/process-thread-locales'
git switch 'feature/process-thread-locales'
git rebase 'feature/native-c-owner-input-cohort'
git switch 'feature/native-c-owner-input-cohort'
git merge --ff-only 'feature/process-thread-locales'
git switch 'feature/process-thread-locales'
git rebase 'feature/native-c-owner-input-cohort'
git switch 'feature/native-c-owner-input-cohort'
git merge --no-ff 'feature/process-thread-locales'
git switch 'feature/native-c-owner-input-cohort'
git merge --squash 'feature/process-thread-locales'
git switch 'feature/native-c-owner-input-cohort'
git merge --ff-only 'feature/process-thread-locales'
git switch 'feature/native-c-owner-input-cohort'
git merge 'feature/process-thread-locales'
git push origin 'feature/native-c-owner-input-cohort'
Sign in to join this conversation.
No description provided.