Complete native extension milestone gate (#84)
All checks were successful
Native code generation / deterministic (push) Successful in 18m9s
Native Rust workspace compile / compile (push) Successful in 21m31s

This commit is contained in:
2026-08-11 04:09:22 +00:00
parent 2558e2f49f
commit d4990f3b07
14 changed files with 617 additions and 197 deletions

View File

@@ -601,6 +601,26 @@ NATIVE_DECLARATIONS = {
"T:LibreMetaverse.Rendering.MeshFoundry": "crate::mesh_foundry::MeshFoundry",
}
# Catalog declarations which are themselves complete native Rust. Unlike
# NATIVE_TYPES, these types intentionally remain in generated.rs: the RLV
# enums are closed value tables and the callback interfaces are Rust traits
# whose required methods are implemented by the host and default adapters.
# Keeping this set explicit lets coverage distinguish concrete generated code
# from a callable failure-only compatibility shell.
NATIVE_GENERATED_TYPES = {
"T:LibreMetaverse.RLV.IRlvActionCallbacks",
"T:LibreMetaverse.RLV.IRlvQueryCallbacks",
"T:LibreMetaverse.RLV.RlvAttachmentPoint",
"T:LibreMetaverse.RLV.RlvGestureState",
"T:LibreMetaverse.RLV.RlvGetDebugType",
"T:LibreMetaverse.RLV.RlvGetEnvType",
"T:LibreMetaverse.RLV.RlvPermissionsService.HoverTextLocation",
"T:LibreMetaverse.RLV.RlvPermissionsService.ObjectLocation",
"T:LibreMetaverse.RLV.RlvPermissionsService.TouchLocation",
"T:LibreMetaverse.RLV.RlvRestrictionType",
"T:LibreMetaverse.RLV.RlvWearableType",
}
NATIVE_MEMBER_BODIES = {
"M:LibreMetaverse.RLV.RlvCommon.TryGetAttachmentPointFromItemName(System.String,System.Nullable{LibreMetaverse.RLV.RlvAttachmentPoint}@)":
"Self::native_try_get_attachment_point_from_item_name(item_name, attachment_point)",
@@ -3523,9 +3543,18 @@ def native_member_body(member_id: str) -> str | None:
return None
def render_body(signature: str, member_id: str, error_model: str, asyncness: str, trait: bool) -> str:
def render_body(
signature: str,
member_id: str,
error_model: str,
asyncness: str,
trait: bool,
required_trait_method: bool = False,
) -> str:
if trait:
signature = signature.removeprefix("pub ")
if required_trait_method:
return f" {signature};"
if body := native_member_body(member_id):
if any(f"LibreMetaverse.{owner}." in member_id for owner in CLIENT_CORE_NATIVE_OWNERS):
marker = " /* native client-core implementation */"
@@ -3647,6 +3676,7 @@ def render_type(item: dict, type_row: dict, member_rows: dict[str, dict[str, str
row["error_model"],
row["asyncness"],
trait,
trait and item["doc_id"] in NATIVE_GENERATED_TYPES,
)
)
lines.append("}")
@@ -3844,7 +3874,9 @@ def coverage_report(catalog: dict, coverage: dict[str, tuple[int, int, bool]]) -
native_type_ids = {
item["doc_id"]
for item in assembly["types"]
if item["doc_id"] in NATIVE_TYPES or item["doc_id"] in NATIVE_DECLARATIONS
if item["doc_id"] in NATIVE_TYPES
or item["doc_id"] in NATIVE_DECLARATIONS
or item["doc_id"] in NATIVE_GENERATED_TYPES
or (name == "LibreMetaverse.Types" and item["kind"] == "enum")
}
native_member_ids = {
@@ -3852,6 +3884,7 @@ def coverage_report(catalog: dict, coverage: dict[str, tuple[int, int, bool]]) -
for item in assembly["types"]
for member in item["members"]
if item["doc_id"] in NATIVE_TYPES
or item["doc_id"] in NATIVE_GENERATED_TYPES
or (name == "LibreMetaverse.Types" and item["kind"] == "enum")
or (
item["doc_id"] in NATIVE_DECLARATIONS