Closed Bug 844146 Opened 11 years ago Closed 11 years ago

accumulating into boolean histograms from C++ can produce bogus histograms

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(2 files)

See bug 811507 for the gory details.  The division between C++ codepaths and JS codepaths may have made sense once upon a time (they might have even been the same at one point), but the histogram code has evolved enough that we can fix this at the lowest levels.
The only trickiness is explained by the comment in ::Accumulate.
Attachment #717219 - Flags: review?(taras.mozilla)
...and now that the histogram bits handle this for us, we don't need
this extra checking.
Attachment #717220 - Flags: review?(taras.mozilla)
Comment on attachment 717219 [details] [diff] [review]
add BooleanHistogram::Accumulate to properly canonicalize values for boolean histograms

Really seems like the underlying vector should be of <bool> of kind.
Attachment #717219 - Flags: review?(taras.mozilla) → review+
Attachment #717220 - Flags: review?(taras.mozilla) → review+
Comment on attachment 717219 [details] [diff] [review]
add BooleanHistogram::Accumulate to properly canonicalize values for boolean histograms

Forgot to mention this: !!value is the standard mozilla way of booleanification. Please change this before landing.
(In reply to Taras Glek (:taras) from comment #3)
> Really seems like the underlying vector should be of <bool> of kind.

That would be nice.  We talked about this once in the context of saving space and it just wasn't worth doing (IIRC, it was going to save 1-2K of memory).

(In reply to Taras Glek (:taras) from comment #4)
> Forgot to mention this: !!value is the standard mozilla way of
> booleanification. Please change this before landing.

Good point.  I will fix the booleanification of |sample|.
https://hg.mozilla.org/mozilla-central/rev/79db8bedd0aa
https://hg.mozilla.org/mozilla-central/rev/e1a74396082e
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: