Proposed PR branch: qe/issue-13-capability-matrix-and-query-safety
Category: Feature Request (API ergonomics + safety hardening)
Problem
- Integrators need a consolidated capability snapshot at startup.
- Varargs query APIs are harder to bind safely.
- Query count handling must be hardened (reject malformed / non-positive counts).
Justification / why this is needed
- Frameworks commonly need a single “capability snapshot” at init to decide
which ops/types/layouts to enable or fall back to CPU.
- Typed wrappers reduce misuse and help bindings avoid varargs entirely.
- Count hardening prevents out-of-bounds reads when inputs are malformed.
Proposed change
- Add
zdnn_get_capability_matrix(...).
- Add typed wrappers:
zdnn_is_nnpa_function_installed_list(...)
zdnn_is_nnpa_parmblk_fmt_installed_list(...)
- Harden varargs count bounds and add safety regressions.
Acceptance criteria
- Capability snapshot validates buffer alignment/size and returns a stable struct.
- Typed wrappers match varargs behavior for equivalent inputs.
- Query rejects non-positive/malformed counts and never reads out of bounds.
- Tests cover snapshot API + wrappers + count hardening.
Test plan
make test (expects:
tests/testDriver_capability_matrix_api.c
tests/testDriver_query_typed_wrappers.c
tests/testDriver_query_count_safety.c)
References
- Baseline report:
artifacts/FINAL_BASELINE_ENHANCEMENT_REPORT.md shows
query count safety regressions failing on baseline+regtests and passing in enhanced.
- Key files:
zdnn/query.c, zdnn/zdnn.h, zdnn/zdnn.map, tests above.
Proposed PR branch:
qe/issue-13-capability-matrix-and-query-safetyCategory:
Feature Request(API ergonomics + safety hardening)Problem
Justification / why this is needed
which ops/types/layouts to enable or fall back to CPU.
Proposed change
zdnn_get_capability_matrix(...).zdnn_is_nnpa_function_installed_list(...)zdnn_is_nnpa_parmblk_fmt_installed_list(...)Acceptance criteria
Test plan
make test(expects:tests/testDriver_capability_matrix_api.ctests/testDriver_query_typed_wrappers.ctests/testDriver_query_count_safety.c)References
artifacts/FINAL_BASELINE_ENHANCEMENT_REPORT.mdshowsquery count safety regressions failing on baseline+regtests and passing in enhanced.
zdnn/query.c,zdnn/zdnn.h,zdnn/zdnn.map, tests above.