| name | sdk-parity-check |
| description | Verify FFI exports have matching wrappers across all 10 language SDKs |
| user-invocable | true |
SDK Parity Check
Scan the FFI layer and verify that every exported function has corresponding wrappers across all 10 language SDKs.
When to Use
Run after adding or modifying FFI functions, after SDK changes, or before releases to verify complete coverage.
SDK Matrix
The engine ships 10 language SDKs under sdks/. Every FFI export MUST have a binding in each:
c, cpp, csharp, go, kotlin, lua, python, rust, swift, typescript
The authoritative coverage gate is codegen/validate_coverage.py, which validates the generated ffi_manifest.json against the resolved FFI contract. The manual audit below is for spot-checking individual functions when coverage fails.
What It Checks
- FFI → SDK parity: Every
#[no_mangle] extern "C" function in goud_engine/src/ffi/ has a matching binding in each of the 10 SDKs
- C# parity: A matching
DllImport declaration in sdks/csharp/generated/
- Python parity: A matching ctypes declaration in
sdks/python/goudengine/generated/_ffi.py
- Signature matching: Parameter types and return types are compatible across the boundary
Manual Audit Process
Step 1: Collect FFI Exports
Find all public FFI functions:
rg "#\[no_mangle\]" goud_engine/src/ffi/ --type rust -A 2
This produces a list of functions like:
#[no_mangle]
pub extern "C" fn create_context(...) -> *mut Context { ... }
Step 2: Check C# Bindings
For each FFI function, verify a matching DllImport exists:
rg "DllImport.*create_context" sdks/csharp/ --type cs
Also check NativeMethods.g.cs (auto-generated by csbindgen):
rg "create_context" sdks/csharp/generated/NativeMethods.g.cs
Step 3: Check Python Bindings
For each FFI function, verify a matching ctypes declaration exists in generated/_ffi.py:
rg "create_context" sdks/python/goudengine/generated/_ffi.py
Step 4: Check for SDK-Only Functions
Look for SDK functions that don't correspond to any FFI export (potential logic-in-SDK violation):
rg "public .* \w+\(" sdks/csharp/ --type cs -g '!NativeMethods*' -g '!obj/*'
rg "def " sdks/python/goudengine/ --type py -g '!test_*'
Automated Coverage Gate
Run the coverage validator, which checks all 10 SDKs against the resolved FFI contract:
python3 codegen/validate_coverage.py
Regenerate all bindings first if the FFI surface changed:
./codegen.sh
Output Format
# SDK Parity Report
## FFI Functions Found: N
## Coverage (per SDK: c, cpp, csharp, go, kotlin, lua, python, rust, swift, typescript)
| FFI Function | Covered SDKs | Missing SDKs | Status |
|-------------|--------------|--------------|--------|
| create_context | 10/10 | — | OK |
| destroy_context | 9/10 | python | MISSING |
| ... | ... | ... | ... |
## Missing Bindings (X)
- function_name (goud_engine/src/ffi/file.rs:LINE) — missing in: <sdk list>
## SDK-Only Logic (potential violations)
- ClassName.Method (sdks/csharp/File.cs:LINE)
## Summary: X/N functions have full parity
Type Mapping Reference
| Rust FFI Type | C# Type | Python ctypes |
|---|
i32 | int | c_int |
u32 | uint | c_uint |
f32 | float | c_float |
f64 | double | c_double |
bool | bool | c_bool |
*mut T | IntPtr | POINTER(T) or c_void_p |
*const c_char | string | c_char_p |
() (void) | void | None |