Expose evaluation limits, cancellation, and usage through public facades
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the listed public headers and facade implementations, especially wirelog/wirelog-easy.c, wirelog/wirelog_advanced.c, and the error mapping in wirelog/extension_registry.c; then review the referenced prerequisite issues and public-header checks. Extend the facade APIs and tests in the named tests/ files, including standalone cases registered in tests/meson.build. Done means the acceptance checklist passes for both facades, typed and untyped evaluation, ABI checks, and applicable sanitizers.
Written by the indexing model from the issue text.
Description
Outcome
Installed-header consumers can configure evaluation work limits, request cancellation from a second thread, read consumed work/stop reason and retry with a larger allowance through both easy and advanced facades. Existing callers keep their behavior.
Parent: #1817. Hard prerequisites: #1819, #1820, #1821, #1822. Public enablement must not expose controls before the supported engine paths enforce them.
Verified starting point
At e8e977ec6ffcc0bcc0b0a4aae56bb842da34b389, wl_session_options_t is internal/uninstalled. Easy open has a size-versioned options prefix and lazy plan/session creation; advanced has ordinary and extension-snapshot constructors, with no public general options. Public evaluation errors flow through wl_facade_session_error_code() defined in wirelog/extension_registry.c; wirelog/api_facade.c is another caller. Existing enum values live in wirelog/wirelog.h.
Required implementation
- Expose an opaque retained evaluation-control handle and create/retain/release/request-cancel, quiescent configuration/reset, and completed-attempt report operations. Use the foundation's one-attached-logical-session ownership and documented concurrency rules; concurrent cancel must operate on independently live control storage, not a possibly destroyed session.
- Append optional control configuration to
wirelog_easy_open_opts_t; preserve all legacy prefix sizes and_reservedvalidation. Claim the control's owner and retain the handle during open, including lazy creation; a second session's open fails immediately. Unwind failed-open references/ownership and pass the same owner identity to the eventual internal session without a second attachment. Constructor options storage may die immediately after open returns. - Add a size/versioned advanced options constructor composing worker/backend selection, control and extension snapshot. Keep existing constructor signatures/default behavior; delegate with NULL/default control. Do not expose internal options, backend structs or C atomics.
- Make limit update/reset and report access usable from both facades, including after a bounded-out attempt while input mutation is pending-retry restricted. Public operations must clearly report active-attempt reconfiguration refusal.
- Add distinct public budget-exhausted and cancelled errors without renumbering existing values; update error strings and
wl_facade_session_error_code(). Preserve precedence relative to expression/OOM and cleanup errors, including typed snapshot wrappers. Do not label legacy execution failures as budget events. - Apply controls to every public evaluating STEP and SNAPSHOT entry point, typed or untyped. Existing legacy executor behavior remains unlimited unless separately opted in; shared error mapping must remain compatible.
- Public names use
wirelog_/WIRELOG_, exported prototypes useWIRELOG_API. If adding a shared installedwirelog/wirelog-evaluation.h, editwirelog_public_headersinmeson.buildfirst, include it consistently, and update enforced public-surface manifests/docs. Internal helpers usewl_evaluation_control_*.
Paths
wirelog/wirelog.h, wirelog/wirelog-types.h, wirelog/wirelog-easy.h, wirelog/wirelog-easy.c, wirelog/wirelog-advanced.h, wirelog/wirelog_advanced.c, wirelog/wirelog-internal.h, wirelog/extension_registry.c, wirelog/api_facade.c, meson.build, wirelog/meson.build; public header/ABI checks as required.
Extend tests/test_wirelog_easy.c, tests/test_wirelog_advanced.c, tests/test_wirelog_public_api.c, tests/standalone/test_standalone_wirelog_easy.c, tests/standalone/test_standalone_wirelog_advanced.c; register any new standalone/control cases in tests/meson.build.
Acceptance
- Installed-header-only C and C++ consumers demonstrate configure → evaluate → read stats → raise limit/reset token → retry, for both facades.
- Easy eager/lazy paths and advanced creation with/without extension snapshot retain the control correctly; caller releases its own reference after open without invalidating evaluation.
- Old option prefixes, NULL options, current macros and old constructors give the same results/statuses as the reference with controls absent.
- New option prefix truncation, unknown version, invalid reserved data, constructor/build failure and active reset refusal have defined tested outcomes.
- Cross-thread cancel and budget exhaustion remain distinguishable from execution and memory failures through every supported typed/untyped evaluation wrapper and
wirelog_error_string(). - Completed reports survive failure and are available before retry. Successful retry emits the original-baseline delta once and allows normal session reuse.
- Public facade/standalone tests, full ABI suite (prefix/export macro/header surface/testhook gates) and applicable ASan/UBSan checks pass.
Non-goals
No environment variable, deadline API, implicit process signal handler, exported internal session_options, or general concurrent session mutation contract. This issue exposes the completed mechanism; #1824 records parent-level conformance and final documentation evidence.
- Dominant language
- C
- Stars
- 18
- Forks
- 2
- Avg merge
- 9h 44m
- Merged PRs (30d)
- 162
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from semantic-reasoning/wirelog
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
semantic-reasoning/wirelog#2229 ·
Maintainers usually reply within 1 day
-
Doc: insert executor and incremental consolidation leave sorted runs, not globally sorted headsOpen
Difficulty 1/5 Under an hour Newbie friendliness 83/100
semantic-reasoning/wirelog#2133 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
semantic-reasoning/wirelog#2042 ·
Maintainers usually reply within 1 day
-
p2-medium
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
semantic-reasoning/wirelog#1914 ·
Maintainers usually reply within 1 day
-
Implement #2310: bounded non-evaluating host source inspection for easy and advanced sessionsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
semantic-reasoning/wirelog#2321 ·
Maintainers usually reply within 1 day
All issues in semantic-reasoning/wirelog
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
arduino/ArduinoCore-megaavr#152 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
FujiNetWIFI/fujinet-firmware#2261 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
kivy/python-for-android#3405 · 1 reaction ·
Maintainers usually reply within 1 day
-
Nmap
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
`nuklear.h` shows old versionPossibly taken @TomJGooding claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Immediate-Mode-UI/Nuklear#1004 ·