Skip to content

LATX, KZT: add per-library-family wrapper controls - #395

Merged
LaurenIsACoder merged 4 commits into
lat-opensource:masterfrom
LaurenIsACoder:lauren/kzt-cairo-native
Aug 13, 2026
Merged

LATX, KZT: add per-library-family wrapper controls#395
LaurenIsACoder merged 4 commits into
lat-opensource:masterfrom
LaurenIsACoder:lauren/kzt-cairo-native

Conversation

@LaurenIsACoder

@LaurenIsACoder LaurenIsACoder commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • classify the existing KZT wrappers into dependency-aware library groups
  • keep group names, bit positions, stable or experimental status, and dependencies in one developer-facing kzt-group-list.h registry
  • add one selector, LATX_KZT_LIBS, for stable, exact, and delta selections
  • keep disabled groups on the guest translation path instead of loading their host wrappers
  • apply the resolved selection consistently to system, user, per-application, environment, command-line, static/direct-loader, and deferred Wine paths
  • add LATX_KZT_LOG=1 diagnostics for the effective group set and per-library wrapper eligibility
  • add latx-x86_64 --kzt-libs so the installed binary reports its groups, stability status, dependencies, and accepted syntax
  • expose -h and --help in product builds so the selector and query are discoverable

The README points users to --kzt-libs instead of duplicating a library-group inventory that would become stale. This PR contains only product, configuration, and documentation changes; it does not add test or audit programs.

Behavior

Normal use remains simple:

LATX_KZT=1

Targeted rollback and debugging use the same selector:

# Remove one group and groups that depend on it from the stable set
LATX_KZT=1 LATX_KZT_LIBS=-x11

# Use one group and its required dependencies
LATX_KZT=1 LATX_KZT_LIBS=x11

Dependencies are resolved before wrapper loading. Disabling a dependency prunes dependent groups, preventing a host object from crossing into a guest-translated dependency. Unknown groups, mixed selector forms, and invalid LATX_KZT or LATX_KZT_LOG values disable KZT for that process and report the reason instead of enabling an unintended wrapper set.

Library-group eligibility only means that LAT may use the registered KZT wrapper. It does not imply that every function in that library reaches a host implementation; custom wrappers may deliberately re-enter guest execution.

Validation

Validated on LoongArch64 with the normal tests=auto product configuration:

  • incremental product build of latx-x86_64: passed
  • final no-work rebuild check: passed
  • -h and --help: exit 0 with identical output
  • help includes LATX_KZT_LIBS, -latx-kzt-libs, and -kzt-libs
  • --kzt-libs: exit 0 without a guest program
  • valid selections stable, x11, and -x11: exit 0 with the expected dependency closure
  • invalid group, LATX_KZT=3, and LATX_KZT_LOG=2: KZT disabled with an explicit reason; guest execution continued successfully
  • per-application configuration for true: selected -x11 and resolved to core
  • real local X.Org display :0: gtkperf completed with LATX_KZT=0, the stable set, LATX_KZT_LIBS=-x11, and LATX_KZT_LIBS=x11
  • enabled X11 runs selected the existing libX11, libX11-xcb, and libxcb-render wrappers; the disabled run kept them on the guest path
  • no RenderBadPicture, new X Error, SIGSEGV, SIGILL, or SIGABRT was observed

Final product binary SHA-256:

d66579f5461f16c982e279c6379a9322cdb1b1cd0cc9b54d6df1865cf7a1884f

@LaurenIsACoder
LaurenIsACoder force-pushed the lauren/kzt-cairo-native branch from 8ee9faf to a44bc13 Compare August 13, 2026 07:58
Add one declarative registry for KZT group names, bit positions, stability, and dependencies, then annotate each existing wrapper with its group. This prepares the registry for dependency-aware controls without changing wrapper selection behavior.

Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
Add Wine-style KZT group selection for command-line and application-specific configuration. Derive group names, default stability, and dependency closure from the central group registry so new families have one policy definition.

Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
The help handler and usage formatter were compiled only for LATX or TCG debug configurations, so product binaries rejected -h and --help.

Make help available in all builds and tolerate argument-table entries without an environment-variable name. Both single- and double-dash option spellings remain supported.

Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
Add --kzt-libs as a no-guest query for the library groups, stability status, dependencies, and accepted LATX_KZT_LIBS syntax compiled into the installed translator.

Keep the README independent of a duplicated group inventory by directing users to the query command. The existing -h and --help output advertises both the selector and query.

Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
@LaurenIsACoder
LaurenIsACoder force-pushed the lauren/kzt-cairo-native branch from a44bc13 to 85c5f0e Compare August 13, 2026 08:19
@LaurenIsACoder
LaurenIsACoder marked this pull request as ready for review August 13, 2026 08:26
@LaurenIsACoder
LaurenIsACoder merged commit 27703d6 into lat-opensource:master Aug 13, 2026
20 checks passed
@LaurenIsACoder
LaurenIsACoder deleted the lauren/kzt-cairo-native branch August 13, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant