Closed Bug 2090866 Opened 17 days ago Closed 17 days ago

Move the delta stats into the generate resolve callback in TextGenerator::Generate

Categories

(Core :: Machine Learning: On Device, defect, P3)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox160 --- wontfix
firefox161 --- wontfix
firefox162 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

Coverity CID 1702186 (COPY_INSTEAD_OF_MOVE).

TextGenerator::Generate (toolkit/components/ml/textgeneration/TextGenerator.cpp) creates auto stats = std::make_shared<DeltaStats>(), hands one reference to MakeDeltaHandler, then captures stats by copy in the SendGenerate()->Then() resolve lambda. Nothing reads the local afterwards, so stats = std::move(stats) saves an atomic refcount increment/decrement per generation. Trivial and mechanical.

Set release status flags based on info from the regressing bug 2046983

:vpollet, since you are the author of the regressor, bug 2046983, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

The handler set by SetDeltaHandler() holds its own reference to stats, and
nothing reads the local after the capture, so the capture can take it rather
than bump the shared_ptr refcount.

Assignee: nobody → sledru
Status: NEW → ASSIGNED
Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7bc1fdbf9e2a https://hg.mozilla.org/integration/autoland/rev/b5d76571abdc Move the delta stats into the generate resolve callback in TextGenerator::Generate (Coverity CID 1702186) r=ai-platform-reviewers,valentinp
Severity: -- → S4
Flags: needinfo?(vpollet)
Priority: -- → P3
Status: ASSIGNED → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: