airborne12 opened a new pull request, #445:
URL: https://github.com/apache/doris-thirdparty/pull/445

   ### Background
   
   `clucene-4.1` starts at `08d45e541fe`, the CLucene revision that Doris 
branch-4.1 and the SelectDB 4.1-based branches pin. This PR carries #444 to 
that line, so a 4.1 branch can store VARIANT path norms sparsely without moving 
to the later `clucene` commits (#420, #421, #438), which need Doris changes 
those branches do not have.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #444 (source, open; picked at 294e26fb805), apache/doris#71166 
(Doris side on master)
   PR Type: Performance
   
   Problem Summary:
   
   Cherry-pick of #444: a field flagged `FlagBits::SPARSE_NORMS` keeps its BM25 
norms only for the documents that hold it, in a new `.nrs` file that decodes to 
the bytes `.nrm` holds, so norms, token counts, and block-max data are 
unchanged. Fields without the flag are unchanged. The rationale, design, and 
measurements are in #444.
   
   ### Details
   
   - **Change map:** the 349 production lines of #444, byte-identical; 287 test 
lines.
   - **Why it was slow / Optimization / Results / Applicability and cost:** as 
in #444.
   - **Adaptation:** `TestSparseNorms` checks a positive token count only for a 
freshly written index. Index compaction on this line predates the token-count 
fix (#420): it writes the whole total into the first destination and 0 into the 
others, so the compaction case compares dense and mixed sources without that 
check.
   
   | File | `@@` hunks | Status |
   |---|---|---|
   | src/core/CLucene/index/{FieldConfig.h, FieldInfos.cpp, IndexWriter.cpp, 
SDocumentWriter.cpp, SDocumentWriter.h, SegmentReader.cpp, SparseNorms.cpp, 
_FieldInfos.h, _SegmentHeader.h, _SparseNorms.h}, src/core/CMakeLists.txt, 
src/test/{CMakeLists.txt, test.h, tests.cpp} | all | Ported(verbatim) (per-file 
patch-id equal to #444) |
   | src/test/index/TestSparseNorms.cpp | `@@ -157,7 +157,7 @@ void 
assertSameNorms(...)` | Adapted: drop `> 0` from the shared check |
   | src/test/index/TestSparseNorms.cpp | `@@ -181,6 +181,9 @@ void 
TestSparseNormsDecodeToDenseNorms(...)` | Adapted: `> 0` checked on the freshly 
written index only |
   | src/test/index/TestSparseNorms.cpp | rest | Ported |
   
   ### Testing
   
   The CLucene UT workflow runs only for PRs to `clucene` and `clucene-2.0`, so 
this PR relies on a local run (clang 20.1.8, `cmake -G Ninja` + `ninja 
cl_test`):
   
   - `./cl_test -x testPFOR`: 100/100 on this branch in two runs (97 existing + 
3 `SparseNorms`); 97/97 on `08d45e541fe`.
   - `./cl_test testPFOR` aborts with `Assertion '__n < this->size()' failed` 
on `08d45e541fe` as well; this line still has the TurboPFor-era test that #421 
replaced. Not changed here.
   - Before the adaptation, `TestCompactionMergesSparseNormsSources` failed on 
this line on the `> 0` check alone; it passes after it.
   
   The SelectDB backport that pins this commit adds Doris BE unit tests on top 
of it.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: verified locally only, since CI 
does not run for this base branch; #444 is still under review and this PR 
follows it.
   
   ### AI Disclosure
   
   - Tool: Claude Code (claude-opus-5-5)
   - Generated: the cherry-pick and its adaptation, this description
   - Human review: TODO(author)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to