[clangd] Make categorical features 64 bit in DecisionForest Model.
authorUtkarsh Saxena <usx@google.com>
Tue, 2 Mar 2021 14:23:36 +0000 (15:23 +0100)
committerUtkarsh Saxena <usx@google.com>
Tue, 2 Mar 2021 15:22:30 +0000 (16:22 +0100)
commitbf935a034b345e905907c80030c67ef8f737d56a
tree62e67c7da4e113d78f4cf42bdd7a23e80feedff2
parent0caf736d7e1d16d1059553fc28dbac31f0b9f788
[clangd] Make categorical features 64 bit in DecisionForest Model.

CodeCompletionContext::Kind has 36 Kinds. The completion model used to
support categorical features of 32 cardinality.
Due to this clangd tests were failing asan tests due to overflow.

This patch makes the completion model support 64 cardinality of
categorical features by storing ENUM Features as uint64_t instead of
uint32_t.

Verified that this fixes the asan failures.

Latency: 6.7ms (old) VS 6.8ms (new) per 1000 predictions.

Differential Revision: https://reviews.llvm.org/D97770
clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp
clang-tools-extra/clangd/quality/CompletionModelCodegen.py