Skip to content

refactor(#495): Separate universal and backend-specific operators in exec_plan enum#504

Merged
justinjoy merged 8 commits intomainfrom
feat/495-separate-backend-ops
Apr 15, 2026
Merged

refactor(#495): Separate universal and backend-specific operators in exec_plan enum#504
justinjoy merged 8 commits intomainfrom
feat/495-separate-backend-ops

Conversation

@justinjoy
Copy link
Copy Markdown
Collaborator

Summary

  • Partition wl_plan_op_type_t enum into universal (0-8) and backend-specific (9+) ranges with #define WL_PLAN_OP__BACKEND_START 9
  • Add ABI assertions for all 12 operator values (0-11) in test_plan_exchange.c
  • Add inline classification helpers: wl_plan_op_is_backend_specific(), wl_plan_op_is_universal()
  • Add _Static_assert boundary check and debug assertion in columnar eval dispatch
  • Fix missing math_dep in bench_col_layout build target

Design decisions

  • Range-based partitioning (Option B) chosen over separate enums (Option A) for minimal blast radius with single-backend reality
  • #define sentinel instead of enum member to avoid collision with WL_PLAN_OP_K_FUSION = 9
  • All numeric values unchanged — pure refactoring, zero behavioral changes

Closes #495

Test plan

  • All 134 tests pass (native C11 build)
  • ABI values 0-11 asserted in test_plan_op_abi_values
  • _Static_assert(WL_PLAN_OP_K_FUSION == WL_PLAN_OP__BACKEND_START) compiles
  • Debug assert in eval dispatch default case does not fire on valid plans
  • No struct layout changes to wl_plan_op_t

bench_col_layout links columnar/session.c which calls sqrt() but was
missing math_dep in its dependency list, causing linker failure.
…pecific ranges

Add range documentation and #define WL_PLAN_OP__BACKEND_START separating
universal operators (0-8, backend-agnostic) from columnar backend
operators (9+, use opaque_data). All numeric values unchanged.
Assert all 12 enum values (0-11) plus WL_PLAN_OP__BACKEND_START
boundary in test_plan_exchange.c. Locks the universal/backend-specific
partition against accidental renumbering.
…classification

wl_plan_op_is_backend_specific() and wl_plan_op_is_universal() provide
programmatic classification of operators against WL_PLAN_OP__BACKEND_START.
…fic ops

Reorganize field-usage comment block into Universal and Backend-specific
sections. Fix opaque_data comment to reference all three backend ops
(K_FUSION, LFTJ, EXCHANGE) instead of only K_FUSION.
…pecific ops

Add _Static_assert verifying WL_PLAN_OP_K_FUSION == WL_PLAN_OP__BACKEND_START
to catch boundary drift at compile time. Replace silent default break in
dispatch switch with assert for unknown op types in debug builds.
Replace exec_plan.h:259 line-number reference with symbol-only reference
to avoid staleness when the enum is reorganized.
…oundary

MSVC C mode does not support _Static_assert. Use typedef array trick
for MSVC, keep _Static_assert for GCC/Clang.
@justinjoy justinjoy merged commit bc6cf39 into main Apr 15, 2026
7 checks passed
@justinjoy justinjoy deleted the feat/495-separate-backend-ops branch April 15, 2026 06:21
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.

refactor: Separate universal and backend-specific operators in exec_plan enum

1 participant