Skip to content

Conversation

@c-bata
Copy link
Member

@c-bata c-bata commented Sep 26, 2025

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

None

What does this implement/fix? Explain your changes.

Fixes a bug of smart filtering in TrialList component.

@c-bata
Copy link
Member Author

c-bata commented Sep 29, 2025

@toshihikoyanase Could you review this PR?

Copy link
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR. I confirmed that it significantly reduced the number of filtered-trial renderings.

I was expecting the results from filtering by trial status and LLM prompts to be merged together, but that's not the case in my environment.
Could you explain how these should be integrated?

Case 1: state filtering, then LLM filtering

  • exclude the Complete status in TrialState.
  • apply a limit by trial number using LLM (i.e., (t) => t.number < 3 in JavaScript).
  • restore Complete status in TrialState

Expected: display the trial #0 to trial #2.
Actual: nothing appears.

image

Case 2: LLM filtering, then state filtering

  • filter the trials by their numbers using LLM.
  • exclude completed trials.

Expected: No trials displayed.
Actual: display the trial #0 to trial #2.

image

@c-bata c-bata force-pushed the fix-trial-list-smart-filter branch from 4b3f8bb to 2203277 Compare September 29, 2025 10:26
@c-bata
Copy link
Member Author

c-bata commented Sep 29, 2025

@toshihikoyanase Thank you for your review! You are completely correct. I fixed that bug in 2203277. Please take a look again 🙇

@toshihikoyanase
Copy link
Member

@c-bata Thank you for your update. I confirmed that the issue regarding the merge of filtering results has been resolved. Next, I'll check the change line by line.

Copy link
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks great to me. I added just a minor comment.


const trials = useMemo(() => {
// Start with LLM filtered trials if available, otherwise all trials
const baseTrials = llmFilteredTrials ?? allTrials
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a strong opinion, but baseTrials reminds me of a base class for the Trial object.
Since we're applying filters step by step here, could we name the filter results something else? Given that these are local variables in small functions, it doesn't matter too much. Just to confirm, I'd like to ask for your opinion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds make sense. I renamed it to trialsBeforeStateFilter in 597ff6c. Let me know if you have any preference or other suggestions!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your update! Looks reasonable.

Copy link
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!!

@toshihikoyanase toshihikoyanase merged commit 5e2c577 into optuna:main Sep 30, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants