Skip to content

v1.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 15:06
ebb286b

Added

  • Holdouts (ContextData::holdouts, HoldoutData, ExperimentData::holdoutIds
    and ExperimentData::holdoutType, all new fields appended last and empty by
    default). An experiment covered by a holdout that holds the unit out
    (arm 0, or arm 1 of a three-arm holdout for an experiment that is not
    full-on) returns variant 0 with control variables and publishes no exposure
    of its own; each covering holdout publishes one ordinary exposure per unit
    type. Overrides and matching assignment rules win over a holdout. Payloads
    without holdouts assign and publish exactly as before. A holdout arm is
    chosen with javascript-sdk's probability scale, so a unit whose hash lands
    exactly on a split boundary gets the same arm in every SDK. Ports
    javascript-sdk#65 and java-sdk#12.
  • Shared variable keys with holdouts, as in java-sdk: a held-out candidate
    never wins a key over a candidate the unit is in; when no candidate wins, the
    first held-out candidate supplies its control value (or the caller default
    if its variant lacks the key). variable_value() publishes the holdout
    exposures of every candidate it checks, and the winner's own exposure only
    when the winner is not held out. peek_variable_value() publishes nothing.
  • contains operator, an alias of in, so the app can start sending
    contains. The C++ evaluator has registered contains as the same
    operator as in (haystack first, then needle) since 1.0.0; 1.1.0 documents
    it and tests every in case through both names. in is unchanged.
  • ClientConfig::application_version: the application version sent as
    X-Application-Version. A whole number of 1 to 18 digits is sent as-is;
    anything else (such as 2.4.1) is sent as 0, as in java-sdk and
    javascript-sdk. ClientConfig keeps its 1.0.0 four-element
    structured-binding shape.

Fixed

  • X-Application-Version was always 0. Every 1.0.x client sent
    X-Application-Version: 0 on context fetches and publishes, and there was no
    option to set it, so the collector could not attribute events to an
    application version. This affects every C++ SDK user who reports on or
    targets application versions; set ClientConfig::application_version to
    send yours. Clients that leave it empty still send 0.

Notes

  • New fields grow the public model and Context layouts; rebuild everything
    that includes the SDK headers when upgrading (see Installed Package in the
    README). ContextData and ExperimentData keep their 1.0.0
    structured-binding shapes (1 and 19 elements); reach holdouts,
    holdoutIds and holdoutType by name. A type derived from either one has
    no such shape: a structured binding of it now binds every member (2 and 21
    names). The same holds for ClientConfig (4 elements; application_version
    by name). Code that aggregate-initializes ExperimentData, ContextData or
    ClientConfig positionally still compiles, but -Wextra reports the
    appended fields as missing initializers.

  • Cached reads cost the same as in 1.0.1 or less. Measured with GCC 15.2 on
    aarch64 with 50 experiments and no holdouts, other paths are slower: the
    first resolution of each experiment by about 2-3% (first peek() 295 to
    304 ns, first treatment() 2,168 to 2,184 ns, with the same allocation
    count), partly from the 24-byte larger cached assignment and partly from
    the holdout checks; and refresh() by about 12% (112 to 126 us, 151 more
    allocations), because it copies the new payload into fresh storage before
    installing it (see below).

  • refresh() copies and indexes the new payload before installing it, so a
    std::bad_alloc while doing so leaves the previous data installed and
    readable. As in 1.0.1, an allocation failure inside a nlohmann/json
    destructor during that copy still terminates the process.

  • All exposures of one treatment() call on a covered experiment, and of one
    variable_value() call (its holdouts' and the winner's), are queued before
    the event logger sees the first of them, so a logger that calls finalize()
    or publish() from that callback sends them all, as javascript-sdk 1.14
    does.