You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "gsmiller (via GitHub)" <gi...@apache.org> on 2024/10/31 14:20:49 UTC
[PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
gsmiller opened a new pull request, #13969:
URL: https://github.com/apache/lucene/pull/13969
(no comment)
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #13969:
URL: https://github.com/apache/lucene/pull/13969#issuecomment-2452189489
Added an assertion and tweaked parameter naming as discussed here over in #13972.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #13969:
URL: https://github.com/apache/lucene/pull/13969#issuecomment-2450411129
> I'm also considering renaming length to to since length usually is a number of entries after from while it's an absolute end offset here
+1. I noticed this as well when writing the assertion.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller closed pull request #13969: minor javadoc correction on VectorUtilSupport#findNextGEQ
URL: https://github.com/apache/lucene/pull/13969
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on PR #13969:
URL: https://github.com/apache/lucene/pull/13969#issuecomment-2450344763
This sounds good to me, maybe extract it to a function to avoid increasing the method size too much? Now that you made me look harder at this code, I'm also considering renaming `length` to `to` since `length` usually is a number of entries after `from` while it's an absolute end offset here.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #13969:
URL: https://github.com/apache/lucene/pull/13969#issuecomment-2450206811
@jpountz thanks for the clarification! Let's not make the javadoc change then since it sounds like a reasonable reason to keep the requirement that values are sorted beginning at index `0` and not `from`. (We could always change it later if it seemed like there was a useful reason to not require values `[0, from]` to be sorted).
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #13969:
URL: https://github.com/apache/lucene/pull/13969#issuecomment-2450301205
@jpountz after thinking a little more, I wonder if an `assert` would make sense to guard against unsorted data between index `0` and `from`? Probably quite unlikely, but would also be nice if that use-case tripped an assert now instead of silently working and then failing later because it didn't adhere to the contract outlined in the javadoc? We could do something like `assert IntStream.range(0, length - 1).noneMatch(i -> buffer[i] > buffer[i + 1]);`. It's trivial but I'm happy to add this if you think it would be reasonable.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on PR #13969:
URL: https://github.com/apache/lucene/pull/13969#issuecomment-2450030846
I wrote the javadocs this way on purpose, so that it would still work to create an IntVector/LongVector that starts before `from` and count the number of values that are less than the target. E.g. something like this:
```java
if (length >= LONG_SPECIES.length() && length - from < LONG_SPECIES.length()) {
// less than LONG_SPECIES.length() doc IDs
LongVector vector = LongVector.fromArray(LONG_SPECIES, values, length - LONG_SPECIES.length());
VectorMask<Long> mask = vector.compare(VectorOperators.LT, target);
return length - LONG_SPECIES.length() + mask.trueCount();
} else {
// other cases
}
```
The current implementation doesn't take advantage of it, so I don't mind removing it, we could add it back later on if we want to take advantatge of it since it's an internal API.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] minor javadoc correction on VectorUtilSupport#findNextGEQ [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #13969:
URL: https://github.com/apache/lucene/pull/13969#issuecomment-2449999971
@jpountz was looking through #13958 retroactively to understand the change and I _think_ I spotted a small javadoc error. Can you take a peek? Even though this is super trivial, I wanted to check with you prior to merging to make sure I'm not missing something. Thanks!
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org