Task: Declare C++ default values for the compute host ram_mb and credit_total members

Table of Contents

This page documents a task in the Hotfix: Valgrind flags compute host ram_mb/credit_total read uninitialized story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

The generated compute host domain classes (host.hpp and host_entity.hpp) must default-construct every non-nullable numeric member to a defined value, so the sqlgen dynamic INSERT path never stringifies an indeterminate member under valgrind.

2. Status

Field Value
State DONE
Parent story Hotfix: Valgrind flags compute host ram_mb/credit_total read uninitialized
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-09-07

3. Acceptance

  • The host entity org declares :default_value: 0 for ram_mb and credit_total, alongside their existing :default: 0.
  • Regenerating compute-cpp emits = 0= member initializers for both members in host.hpp and host_entity.hpp, and changes no other file.
  • The compute-cpp drift check is clean.
  • The generated host eventing integration test runs under valgrind with zero errors; the full preset build and the ctest suite are green.

4. Plan

4.1. Phase 1 — model. Add :default_value: 0 to the ram_mb (bigint,

cpp_type std::int64_t) and credit_total (numeric, cpp_type double) member blocks in ores.compute.host.org. :default_value: is the key the class-header template emits into the member-initializer list; :default: is SQL-side only and the codegen synthesizes a C++ initializer for bool/int members alone, so int64_t/double members without an explicit :default_value: stay indeterminate.

4.2. Phase 2 — regenerate. Regenerate compute-cpp in place via the

component drift check script; the diff must be exactly the org plus the two domain headers.

4.3. Phase 3 — prove. Full preset rebuild; valgrind memcheck on the

generated write_host_publishes_nats_changed_event integration test (before: 299 uninitialised-value errors / 137 contexts on CDash dynamic analysis; after: zero); full ctest suite with a CDash Experimental submit; compute-cpp drift check clean; site build.

5. Notes

6. Test Scenarios

Manual QA scenarios (scaffolded via compass add test_scenario, run through the QA Validation Runner panel) that verify this task. Link new ones here as they're created; the scenario doc itself links back via its "Verifies task" field.

Scenario State Notes
     

7. PRs

PR Title
#2026 [ores.compute] Fix valgrind uninitialised-value defects on the host eventing integration test

8. Review

# Comment summary File Decision Notes
1 (review round 1, PR #2026) credit_total emits an int-literal initializer (= 0); double members elsewhere use :default_value: 0.0 rendering = 0.0. Cosmetic, non-blocking. projects/ores.compute/modeling/ores.compute.host.org Accept Fixed in bd92b24a34.
2 (review round 1, PR #2026) Suggests a follow-up task: synthesize = 0/= 0.0 for all non-nullable arithmetic cpp_types, or fail codegen when such a member lacks :default_value:, closing the defect class. doc/agile/versions/v0/sprint_25/fix-compute-host-uninitialized-numerics/story.org Noted Already captured verbatim in the story's * Out of scope (both remediation options); scheduling it as its own codegen task is a separate decision.

9. Result

Delivered. The host entity org now declares :default_value: 0 on the ram_mb and credit_total member blocks, next to their existing :default: 0. Regenerating compute-cpp emitted std::int64_t ram_mb = 0; and double credit_total = 0; in both generated headers (host.hpp, host_entity.hpp) and changed no other file (df0eef8b98).

Verification. Full linux-clang-debug-make preset rebuild clean. Valgrind memcheck with build/valgrind/custom.supp on the generated write_host_publishes_nats_changed_event integration test: all tests passed, "ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 3 from 3)" — the CDash dynamic-analysis defect (build 4048425, dynamic analysis 8054036: 299 errors across 137 contexts) is gone. Full ctest suite green: 71 test executables, zero failures, CDash Experimental submitted. compute-cpp drift check: "No drift: regenerated output matches the checked-in tree." Site build clean.

Emacs 29.3 (Org mode 9.6.15)