New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 917185 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ML Service: Simplify ModelId enum

Project Member Reported by amoylan@chromium.org, Dec 20

Issue description

Currently in model.mojom we have:

enum ModelId {
  UNKNOWN,
  TEST_MODEL,
  SMART_DIM,
  kMax = SMART_DIM,
};

Reasons for UNKNOWN and kMax:
* We use the UNKNOWN in a check for out-of-range model IDs, and in a unit test of that check.
* We use the kMax in that check too, and the kMax is also needed (for eg Uma logging).

However it turns out that Mojo already validates enum values, so we shouldn't need the check. So we should remove UNKNOWN and update the unit test.

Also, after the next Mojo uprev, Mojo will generate a max value for us in the enum and we can remove kMax.

Rough steps:
1. Update the enum to have explicit values for the models. TEST_MODEL = 1 etc.
2. Remove UNKNOWN. Update the unit test to pass an invalid numerical value like 0 or -5, with the expected behaviour being no-response.
3. Propagate both the above changes to Chromium repo.
4. Wait for Mojo uprev.
5. Remove kMax.


 
Cc: pmalani@chromium.org

Sign in to add a comment