Subcontext: refactor evaluation stages from context#442
Conversation
| // This scope ensures that all ephemeral and cached objects are removed | ||
| // from the store at the end of the evaluation | ||
| auto store_cleanup_scope = store_.get_eval_scope(); | ||
| auto storecleanup_scope = store.get_eval_scope(); |
There was a problem hiding this comment.
Will fix with any review comments or in a subsequent PR.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## anilm3/v2 #442 +/- ##
==========================================
Coverage 85.23% 85.24%
==========================================
Files 181 182 +1
Lines 9356 9362 +6
Branches 4065 4067 +2
==========================================
+ Hits 7975 7981 +6
Misses 538 538
Partials 843 843
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Benchmarks clangBenchmark execution time: 2025-08-19 17:36:49 Comparing candidate commit 1b1da69 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics. scenario:global-benchmark.random.clang
|
Benchmarks gccBenchmark execution time: 2025-08-19 17:38:08 Comparing candidate commit 1b1da69 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
Artifact Size Comparison 📦
|
Benchmarks clang-pgoBenchmark execution time: 2025-08-19 13:01:07 Comparing candidate commit 1b1da69 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
f0198ef to
1b1da69
Compare
* Object view: read only abstraction to ddwaf_object (#341) * [v2] Remove mingw builds (#381) * Writable objects: owned and borrowed object and object limits removal (#378, #382) * [v2] Refactor and improve object types (#387) * [v2] Update unit tests to use new abstractions (#389) * [v2] Update `raw_configuration` type to use `object_view` (#390) * [v2] Remove remaining uses of ddwaf_object in `src` and `tests/unit` (#391) * [v2] JWT Decoding Processor (#401) * [v2] First iteration of object layout changes (#394) * Split context data insertion from evaluation (#407) * [v2] Second iteration of object layout changes (#408) * [v2] Add new fingerprint and object view tests (#414) * Reenable attribute collector unit test (#415) * [v2] Container view types (#413) * Exclude assertions from coverage (#416) * [v2] Use allocators internally instead of malloc/free and stop generating zero-terminated strings (#418) * Add memory resource to owned and borrowed objects (#428) * [v2] Propagate allocators from context (#420) * [v2] Update interface and expose allocators (#427) * Refactor evaluation stages out of the context (#442) * Subcontext: replace ephemerals with a new scope with user-defined lifetime derived from the context (#443) * Validator: Add support for testing subcontexts and attributes (#451) * [v2] Pass allocator to context and subcontext eval and add new allocators (#452) * Update logger to avoid dependencies on ddwaf.h (#453) * [v2] Return DDWAF_MATCH when there are events, attributes or actions (#455) * [v2] Cleanup: remove exclusion namespace and some redundant references (#456)
Subcontexts will be implemented by:
context,subcontext) to the evaluation processattribute::noneandattribute::ephemeral)subcontextandsubcontext_wrapperclass which will be created from the current context (and with a linked lifecycle)To do this, the evaluation process must be refactored out of the context, so that it can be used separately within the subcontext using the correct scope. This PR does exactly this first step, splitting these from
contextinto theevaluation_engine.The next PR will:
context,subcontext).