[all-commits] [llvm/llvm-project] 985deb: Revert "Temporarily Revert "[clangd] Add Random Fo...

UTKARSH SAXENA via All-commits all-commits at lists.llvm.org
Sat Sep 19 02:21:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 985deba9319be464673c1002767f8a3ec597480d
      https://github.com/llvm/llvm-project/commit/985deba9319be464673c1002767f8a3ec597480d
  Author: Utkarsh Saxena <usx at google.com>
  Date:   2020-09-19 (Sat, 19 Sep 2020)

  Changed paths:
    M clang-tools-extra/clangd/CMakeLists.txt
    A clang-tools-extra/clangd/quality/CompletionModel.cmake
    A clang-tools-extra/clangd/quality/CompletionModelCodegen.py
    A clang-tools-extra/clangd/quality/README.md
    A clang-tools-extra/clangd/quality/model/features.json
    A clang-tools-extra/clangd/quality/model/forest.json
    M clang-tools-extra/clangd/unittests/CMakeLists.txt
    M clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
    A clang-tools-extra/clangd/unittests/DecisionForestTests.cpp
    A clang-tools-extra/clangd/unittests/decision_forest_model/CategoricalFeature.h
    A clang-tools-extra/clangd/unittests/decision_forest_model/features.json
    A clang-tools-extra/clangd/unittests/decision_forest_model/forest.json

  Log Message:
  -----------
  Revert "Temporarily Revert "[clangd] Add Random Forest runtime for code completion.""

We intend to replace heuristics based code completion ranking with a Decision Forest Model.

This patch introduces a format for representing the model and an inference runtime that is code-generated at build time.
- Forest.json contains all the trees as an array of trees.
- Features.json describes the features to be used.
- Codegen file takes the above two files and generates CompletionModel containing Feature struct and corresponding Evaluate function.
   The Evaluate function maps a feature to a real number describing the relevance of this candidate.
- The codegen is part of build system and these files are generated at build time.
- Proposes a way to test the generated runtime using a test model.
  - Replicates the model structure in unittests.
  - unittest tests both the test model (for correct tree traversal) and the real model (for sanity).

This reverts commit 549e55b3d5634870aa9d42135f51ad46a6a0e347.




More information about the All-commits mailing list