Skip to content

Conversation

@recursix
Copy link
Collaborator

@recursix recursix commented Jul 11, 2025

Description by Korbit AI

What change is being made?

Add scale factor handling in the DOM property extraction and allow adjustable repetition counts in benchmark function definitions.

Why are these changes being made?

These changes are implemented to enhance the accuracy of bounding box dimensions by incorporating a scale factor into the DOM extraction process, a necessity for environments with varying resolutions. The benchmarks have been adjusted to accept a repetition count parameter, allowing for increased flexibility in testing scenarios which can enhance the benchmarking processes.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Documentation Missing scale_factor documentation ▹ view
Files scanned
File Path Reviewed
browsergym/experiments/src/browsergym/experiments/benchmark/configs.py
browsergym/core/src/browsergym/core/observation.py
browsergym/core/src/browsergym/core/env.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +630 to +631
scale_factor = getattr(self.page, "_bgym_scale_factor", 1.0)
extra_properties = extract_dom_extra_properties(dom, scale_factor=scale_factor)
Copy link

Choose a reason for hiding this comment

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

Missing scale_factor documentation category Documentation

Tell me more
What is the issue?

The scale_factor parameter usage is not documented, making it unclear why and when this scaling is applied.

Why this matters

Future maintainers won't understand the purpose of _bgym_scale_factor or know when to adjust this value.

Suggested change ∙ Feature Preview

Add comment above scale_factor line:

Apply viewport scaling factor to handle high DPI displays

scale_factor = getattr(self.page, "_bgym_scale_factor", 1.0)

Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

@amanjaiswal73892 amanjaiswal73892 merged commit 79ac68e into main Jul 11, 2025
14 checks passed
@amanjaiswal73892 amanjaiswal73892 deleted the fix_bbox_scale branch July 11, 2025 18:13
layahaasini pushed a commit to layahaasini/BrowserGym that referenced this pull request Nov 21, 2025
* fix bbox scale in extra_properties and prevent extract_screenshot from clearing CDP

* add the n_repeats argument to benchmark creation
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.

3 participants