Repository navigation
feat(web): add fine-grained resource locks, native site replicas, and browser reuse - #6936
Draft
JeffPengCoder wants to merge 8 commits into
Draft
JeffPengCoder wants to merge 8 commits into
JeffPengCoder wants to merge 8 commits into
Conversation
…sk 602 Align VisualWebArena's runtime profile and clean-state isolation with failure modes observed in the full 908-task Nano Omni specialist run (256/908 on Gym 1893b3e): - Uncap scroll_amount in benchmarks/visualwebarena/config.yaml (max_scroll_amount: null and nano_omni_max_scroll_amount: null), which routes >50-click scrolls through the existing timeout-bounded scroll subprocess, and restore the uncapped schema wording in nemo_gym/web/computer_use.py when max_scroll_amount is None. All 22 invalid_tool_arguments truncations in the 908-task run were caused by scroll_amount values of 60, 80, or 100 hitting the default cap of 50. - Explicitly enable nano_omni_stop_at_step_budget: true in benchmarks/visualwebarena/configs/nano_omni.yaml so the Nano Omni composition matches the PR NVIDIA-NeMo#6325 empty-answer step-budget contract without changing the shared web_agent default. - Verify Postmill login in resources_servers/webarena_browser/site_auth.py (_verify_reddit_login) by loading /messages and confirming the authenticated .site-nav username before exposing a task to the policy. - Move VisualWebArena task 602 (visualwebarena-604, which renames the shared Reddit fixture account) into protected clean-state Epoch 6 alongside disjoint Shopping task 92 (("92", "602")) and observe the Reddit baseline profile/messages state in shared_state.py, preventing ordinary mutating Reddit tasks from losing authentication without adding an extra site reset. - Document the nine protected tasks, uncapped scroll, step-budget setting, and site_pool_mode concurrency trade-off in benchmarks/visualwebarena/README.md. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Signed-off-by: Jeff Peng <jepeng@nvidia.com>
…romium reuse
Accelerate stateful WebArena and VisualWebArena rollouts by separating
logical resource-level mutexes, per-site concurrency caps, and horizontal
site-replica pools:
- Extend LocalSiteLockPool (nemo_gym/web/site_pool.py) with optional
per-site concurrency caps (max_sessions_by_site /
local_locks_max_sessions_per_site) and multi-replica URL pools
(site_replicas), balancing ordinary tasks across least-loaded replicas
while pinning protected clean-state tasks (task_kwargs["shared_state"])
to replica 0.
- Propagate leased replica URLs through WebSessionManager as immutable
per-session task_kwargs["site_url_overrides"], consumed by
resources_servers/webarena_browser/site_auth.py (configured_site_urls)
so login, start URLs, collision snapshots, and evaluators all bind
atomically to the leased replica. Also resolve WA_<SITE>_REPLICAS
environment variables in WebArenaBrowserSessionManager.
- Add derive_resource_site_locks (nemo_gym/web/evaluation_collision.py)
and --lock-granularity {resource,site} plus LPT priority ordering
(cross-site -> shopping:orders -> remaining) in
benchmarks/visualwebarena/run.py so independent writers run concurrently
while shared carts/orders, same-SKU reviews, and identical fixed-URL
targets remain serialized per replica.
- Add thread-affine reuse_browser_process option to VisualBrowserDriver
with shutdown cleanup in browser_instance.py, and enable uncapped
scroll_amount and browser reuse in VisualWebArena and WebArena configs.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
…unify shopping cart/order locks Signed-off-by: Jeff Peng <jepeng@nvidia.com>
…te limits, and interleave site queues Signed-off-by: Jeff Peng <jepeng@nvidia.com>
…ml locators as valid miss Signed-off-by: Jeff Peng <jepeng@nvidia.com>
…d restore safe per-replica defaults Signed-off-by: Jeff Peng <jepeng@nvidia.com>
…ture evolution Signed-off-by: Jeff Peng <jepeng@nvidia.com>
…ermaid diagrams Signed-off-by: Jeff Peng <jepeng@nvidia.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #6918 (
fix/visualwebarena-scroll-auth-budget). Accelerates WebArena and VisualWebArena evaluation without weakening state isolation by decoupling logical conflict locking, per-replica concurrency caps, horizontal hot-site replicas, and browser process lifecycle:nemo_gym/web/site_pool.py,nemo_gym/web/evaluation_collision.py,nemo_gym/web/resource_config.py):derive_resource_site_locksderives conflict-scoped lock keys from collision plans (unifyingshopping_ordersand/checkout/cartontoshopping:cart, scopingshopping_reviewsby SKU, and scopingprogram_html/page_image_queryby target key) instead of serializing an entire site on a single coarse write lock.LocalSiteLockPoolenforces independent per-replicamax_sessions_by_siteandmax_writers_by_siteconcurrency caps with async waiting, plus site-interleaved / lock-bucket-interleaved scheduling inbenchmarks/visualwebarena/run.py(--lock-granularity {resource,site}).site_replicas/WA_<SITE>_REPLICAS):LocalSiteLockPoolselects the least-loaded conflict-free replica per session (pinningshared_stateprotected epochs to replica0), propagates per-sessionsite_url_overridesthroughSessionManager->site_auth.py, and binds per-sessionWA_<SITE>env vars via_scoped_site_env()inresources_servers/webarena_browser/evaluators.pyso reference snapshots and evaluators always hit the leased replica.nemo_gym/web/visual_browser.py,resources_servers/webarena_browser/backend.py,visualwebarena_evaluation.py):reuse_browser_process(persistent Chromium per browser slot with freshBrowserContextper episode and clean shutdown viaclose_reusable_browsers).block_external_hostsinWebArenaBrowserDriveraborts unreachable external HTTP/HTTPS requests immediately instead of waiting on OS TCP SYN timeouts (fixing task643, which previously hung for 108 minutes on dead external links).wait_for_load_state("networkidle", timeout=5000)in_after_start_navigationto prevent Magento async header hydration ("Welcome to One Stop Market") from shiftingMy AccountontoSign Outunder high concurrency.TypeError: Cannot read properties of null/undefinedinside VisualWebArenalambda:program_htmllocators (e.g. task354on non-product pages) as a valid0.0miss instead of raisingEvaluatorInfrastructureError.benchmarks/webarena/config.yamlwith uncapped scroll (max_scroll_amount: null,nano_omni_max_scroll_amount: null) andreuse_browser_process: true.No separate issue is required; this directly follows up on VisualWebArena/WebArena clean-state evaluation throughput and #6918.
Validation
Local unit tests & pre-commit (run against final commit
d8b6725591f8f6f53dc819a29ee2720cbde6b53f)pytest tests/unit_tests/web/ benchmarks/visualwebarena/tests/ benchmarks/webarena/tests/ responses_api_agents/web_agent/tests/ resources_servers/webarena_browser/tests/{test_site_auth,test_shared_state,test_contract,test_pooled_backend}.py: 582 passed, 2 skipped, 0 failedpre-commit run --files <all changed files>: all hooks passed (ruff,ruff-format,guardwords-check,import-linter,update-environment-list)Signed-off-by).Real-model rollout evidence (
vwa-v10/iter_0001253/mcore_to_hf)83, 121, 559, 602, 718, H100 + 8x Shopping + 2x Reddit + 2x Classifieds):4 / 5(80.0%) (read-only: 3/3incl.559,epoch-6: 1/1task602clean reset verified).Accel-R1, commita692e403b, 4x8 H100 TP8, 64 browsers, 8x Shopping + 2x Reddit + 2x Classifieds,max_sessions_by_site: {shopping: 6, reddit: 4, classifieds: 6}):276 / 908(30.40%),complete: true, 908/908 valid unique task IDs (+20tasks /+2.21ppover single-stackClean-R1256 / 908 = 28.19%;invalid_tool_arguments: 22 -> 0; Shopping Wishlist recovered from22/52 (42.3%)to26/52 (50.0%)by sharding across 8 replicas below Magento's 50-item pagination limit).mutatingwave reduced from ~18-20h -> 105 min, ~11x faster).0fa5f5fca/fbe38260d, 4x8 B200 TP8, 64 browsers, 8x/16x Shopping + 4x Reddit + 4x Classifieds):block_external_hostscut task643from 108 min / 99 steps (0.0) to 17 steps (1.0) and cutread-onlywall time from 135 min to ~87 min;mutatingreached 117 simultaneous fine-grained write locks and completed 397/407 tasks in 75 min (~15x faster than baseline).fbe38260dandd8b672559: (1) task354lambda:null-DOMTypeErrorfalse infrastructure failure, and (2) Magento async header hydration layout shift under 16x Shopping + 64-browser CPU saturation (login_retryrose 29 -> 274 andMy Accountshifted ontoSign Outon step 0, causing tasks338/339/347to sign out and degrading Shopping accuracy), motivating thenetworkidlestart-page settle and keeping defaultmax_sessions_by_siteat the proven{shopping: 6, reddit: 4, classifieds: 6}.Compatibility & Notes
site_replicas,block_external_hosts,reuse_browser_process,max_writers_by_site,--lock-granularity) remain backward-compatible with single-site deployments and--lock-granularity site.nemo_gym/web/**,resources_servers/webarena_browser/**, andbenchmarks/**). Kept as Draft pending fix(visualwebarena): uncap scroll, verify Reddit auth, and isolate task 602 #6918 merge/rebase and optional re-run ond8b672559.Generated with Devin