helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: llama: fix early stop in params_fit if ctx is set

Should at least partially fix https://github.com/ggml-org/llama.cpp/issues/18066 .

The early return on context reduction is done too often, in particular it should never be done if the user is explicitly setting a context size.

For a single GPU we can always safely return if we can fit the model via context reduction. However, for multiple GPUs however this is unsafe so we should always go on to fit.

Changed files:
filename: src/llama.cpp
patch: @@ -241,6 +241,13 @@ static void llama_params_fit_impl(
                     global_surplus += memory_reduction;
                     LLAMA_LOG_INFO("%s: context size reduced from %" PRIu32 " to %" PRIu32 " -> need %" PRId64 " MiB less memory in total\n",
                         __func__, hp_nct, cparams->n_ctx, memory_reduction/MiB);
+                    if (global_surplus >= 0) {
+                        if (nd == 1) {
+                            LLAMA_LOG_INFO("%s: entire model can be fit by reducing context\n", __func__);
+                            return;
+                        }
+                        LLAMA_LOG_INFO("%s: entire model should be fit across devices by reducing context\n", __func__);
+                    }
                 } else {
                     LLAMA_LOG_INFO("%s: default model context size is %" PRIu32 " which is <= the min. context size of %" PRIu32 " -> no change\n",
                         __func__, hp_nct, n_ctx_min);
@@ -249,10 +256,6 @@ static void llama_params_fit_impl(
                 LLAMA_LOG_INFO("%s: context size set by user to %" PRIu32 " -> no change\n", __func__, cparams->n_ctx);
             }
         }
-        if (global_surplus >= 0) {
-            LLAMA_LOG_INFO("%s: entire model can be fit across devices by reducing context\n", __func__);
-            return;
-        }
     }
 
     if (mparams->n_gpu_layers != default_mparams.n_gpu_layers) {
Repository: ollama/ollama
Pull request: Reload model if `num_gpu` changes


Changed files:
filename: server/sched.go
patch: @@ -421,23 +421,29 @@ func (runner *runnerRef) needsReload(ctx context.Context, req *LlmRequest) bool
 	slog.Debug("evaluating already loaded", "model", req.model.ModelPath)
 	runner.refMu.Lock()
 	defer runner.refMu.Unlock()
-	// Ignore the NumGPU settings for comparison
-	optsExisting := runner.Options.Runner
-	optsExisting.NumGPU = -1
-	optsNew := req.opts.Runner
-	optsNew.NumGPU = -1
+
 	timeout := 10 * time.Second
 	if runner.loading {
 		timeout = 2 * time.Minute // Initial load can take a long time for big models on slow systems...
 	}
-	ctx, cancel := context.WithTimeout(ctx, timeout) // BUG -
+
+	// Don't reload runner if num_gpu=-1 was provided
+	optsExisting := runner.Options.Runner
+	optsNew := req.opts.Runner
+	if optsNew.NumGPU < 0 {
+		optsExisting.NumGPU = -1
+		optsNew.NumGPU = -1
+	}
+
+	ctx, cancel := context.WithTimeout(ctx, timeout)
 	defer cancel()
 	if !reflect.DeepEqual(runner.adapters, req.model.AdapterPaths) || // have the adapters changed?
 		!reflect.DeepEqual(runner.projectors, req.model.ProjectorPaths) || // have the projectors changed?
 		!reflect.DeepEqual(optsExisting, optsNew) || // have the runner options changed?
 		runner.llama.Ping(ctx) != nil {
 		return true
 	}
+
 	return false
 }
 

filename: server/sched_test.go
patch: @@ -490,6 +490,9 @@ func TestNeedsReload(t *testing.T) {
 	require.False(t, resp)
 	req.opts.NumGPU = 99
 	resp = runner.needsReload(ctx, req)
+	require.True(t, resp)
+	req.opts.NumGPU = -1
+	resp = runner.needsReload(ctx, req)
 	require.False(t, resp)
 }
Repository: facebook/react
Pull request: Fix unstable_useContextWithBailout dispatcher assignment

One more copy pasta fix

Assignments are unique now
```
% cat packages/react-reconciler/src/ReactFiberHooks.js | grep .unstable_useContextWithBailout
function unstable_useContextWithBailout<T>(
  (ContextOnlyDispatcher: Dispatcher).unstable_useContextWithBailout =
  (HooksDispatcherOnMount: Dispatcher).unstable_useContextWithBailout =
    unstable_useContextWithBailout;
  (HooksDispatcherOnUpdate: Dispatcher).unstable_useContextWithBailout =
    unstable_useContextWithBailout;
  (HooksDispatcherOnRerender: Dispatcher).unstable_useContextWithBailout =
    unstable_useContextWithBailout;
    (HooksDispatcherOnMountInDEV: Dispatcher).unstable_useContextWithBailout =
        return unstable_useContextWithBailout(context, select);
    (HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).unstable_useContextWithBailout =
        return unstable_useContextWithBailout(context, select);
    (HooksDispatcherOnUpdateInDEV: Dispatcher).unstable_useContextWithBailout =
        return unstable_useContextWithBailout(context, select);
    (HooksDispatcherOnRerenderInDEV: Dispatcher).unstable_useContextWithBailout =
        return unstable_useContextWithBailout(context, select);
    (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).unstable_useContextWithBailout =
        return unstable_useContextWithBailout(context, select);
    (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).unstable_useContextWithBailout =
        return unstable_useContextWithBailout(context, select);
    (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).unstable_useContextWithBailout =
        return unstable_useContextWithBailout(context, select);
```

Changed files:
filename: packages/react-reconciler/src/ReactFiberHooks.js
patch: @@ -4622,7 +4622,7 @@ if (__DEV__) {
       };
   }
   if (enableContextProfiling) {
-    (HooksDispatcherOnUpdateInDEV: Dispatcher).unstable_useContextWithBailout =
+    (HooksDispatcherOnRerenderInDEV: Dispatcher).unstable_useContextWithBailout =
       function <T>(
         context: ReactContext<T>,
         select: (T => Array<mixed>) | null,
Repository: electron/electron
Pull request: fix: silent printing of PDFs with `webContents.print`

Backport of #47378

See that PR for details.


Notes: Fixed an issue where printing PDFs with `webContents.print({ silent: true })` would fail. 


Changed files:
filename: patches/chromium/printing.patch
patch: @@ -666,7 +666,7 @@ index 6809c4576c71bc1e1a6ad4e0a37707272a9a10f4..3aad10424a6a31dab2ca393d00149ec6
    PrintingFailed(int32 cookie, PrintFailureReason reason);
  
 diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
-index 08af2c8458fdc2539b437c3ff7e3fa2b5d36eeda..5a8d2f3cc57a66535afb027ee43eebc3b3ffe41c 100644
+index 08af2c8458fdc2539b437c3ff7e3fa2b5d36eeda..bac316baaf4340848666085b3de69c99ee522abe 100644
 --- a/components/printing/renderer/print_render_frame_helper.cc
 +++ b/components/printing/renderer/print_render_frame_helper.cc
 @@ -52,6 +52,7 @@
@@ -744,7 +744,7 @@ index 08af2c8458fdc2539b437c3ff7e3fa2b5d36eeda..5a8d2f3cc57a66535afb027ee43eebc3
    print_preview_context_.OnPrintPreview();
  
  #if BUILDFLAG(IS_CHROMEOS)
-@@ -2062,17 +2068,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
+@@ -2062,17 +2068,25 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
  
  void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
                                     const blink::WebNode& node,
@@ -759,6 +759,12 @@ index 08af2c8458fdc2539b437c3ff7e3fa2b5d36eeda..5a8d2f3cc57a66535afb027ee43eebc3
    FrameReference frame_ref(frame);
  
 -  if (!InitPrintSettings(frame, node)) {
++  // If we're silently printing a PDF, we bypass settings logic
++  // that sets modifiability to false so ensure it's set here.
++  if (silent && IsPrintingPdfFrame(frame, node)) {
++    settings.Set(kSettingPreviewModifiable, false);
++  }
++
 +  if (!InitPrintSettings(frame, node, std::move(settings))) {
      // Browser triggered this code path. It already knows about the failure.
      notify_browser_of_print_failure_ = false;
@@ -767,7 +773,7 @@ index 08af2c8458fdc2539b437c3ff7e3fa2b5d36eeda..5a8d2f3cc57a66535afb027ee43eebc3
      DidFinishPrinting(PrintingResult::kFailPrintInit);
      return;
    }
-@@ -2093,8 +2101,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
+@@ -2093,8 +2107,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
          print_pages_params_->params->print_scaling_option;
  
      auto self = weak_ptr_factory_.GetWeakPtr();
@@ -784,7 +790,7 @@ index 08af2c8458fdc2539b437c3ff7e3fa2b5d36eeda..5a8d2f3cc57a66535afb027ee43eebc3
      // Check if `this` is still valid.
      if (!self)
        return;
-@@ -2362,29 +2377,43 @@ void PrintRenderFrameHelper::IPCProcessed() {
+@@ -2362,29 +2383,43 @@ void PrintRenderFrameHelper::IPCProcessed() {
  }
  
  bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame,
Repository: ollama/ollama
Pull request: llm: limit generation to 10x context size to avoid run on generations


Changed files:
filename: api/types.go
patch: @@ -396,8 +396,10 @@ func (opts *Options) FromMap(m map[string]interface{}) error {
 func DefaultOptions() Options {
 	return Options{
 		// options set on request to runner
-		NumPredict:       -1,
-		NumKeep:          0,
+		NumPredict: -1,
+
+		// set a minimal num_keep to avoid issues on context shifts
+		NumKeep:          4,
 		Temperature:      0.8,
 		TopK:             40,
 		TopP:             0.9,

filename: llm/server.go
patch: @@ -560,6 +560,13 @@ func (s *llmServer) Completion(ctx context.Context, req CompletionRequest, fn fu
 		return err
 	}
 	defer s.sem.Release(1)
+
+	// only allow maximum 10 "context shifts" to avoid infinite generation
+	if req.Options.NumPredict < 0 || req.Options.NumPredict > 10*s.options.NumCtx {
+		req.Options.NumPredict = 10 * s.options.NumCtx
+		slog.Debug("setting token limit to 10x num_ctx", "num_ctx", s.options.NumCtx, "num_predict", req.Options.NumPredict)
+	}
+
 	request := map[string]any{
 		"prompt":            req.Prompt,
 		"stream":            true,
Repository: facebook/react
Pull request: [compiler] Reordering of logical expressions

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #30678



Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/logical-reorder.flow.expect.md
patch: @@ -6,11 +6,7 @@
 
 const foo = undefined;
 
-component C(
-  ...{
-    scope = foo ?? null,
-  }: any
-) {
+component C(...{scope = foo ?? null}: any) {
   return scope;
 }
 

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/logical-reorder.flow.js
patch: @@ -2,11 +2,7 @@
 
 const foo = undefined;
 
-component C(
-  ...{
-    scope = foo ?? null,
-  }: any
-) {
+component C(...{scope = foo ?? null}: any) {
   return scope;
 }
Repository: huggingface/transformers
Pull request: [testing] reduce runtime of `HunYuanMoEV1IntegrationTest:test_model_generation`

# What does this PR do?

This test takes 26 minutes to run, way too much to be helpful.

Let's reduce `max_new_tokens` to `10` and runs in 7 minutes.

Changed files:
filename: tests/models/hunyuan_v1_moe/test_modeling_hunyuan_v1_moe.py
patch: @@ -16,6 +16,7 @@
 import unittest
 
 import pytest
+import torch
 from parameterized import parameterized
 
 from transformers import is_torch_available
@@ -99,10 +100,12 @@ def tearDown(self):
     def test_model_generation(self):
         # we will compele this when model file change over
         # pass
-        EXPECTED_ANSWER = "\nOkay, I need to write a short summary about the benefits of regular exercise. Let me start by recalling what I know. First,"
+        EXPECTED_ANSWER = "\nOkay, I need to write a"
         prompt = "Write a short summary of the benefits of regular exercise"
         tokenizer = AutoTokenizer.from_pretrained("tencent/Hunyuan-A13B-Instruct")
-        model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-A13B-Instruct", device_map="auto")
+        model = AutoModelForCausalLM.from_pretrained(
+            "tencent/Hunyuan-A13B-Instruct", device_map="auto", dtype=torch.bfloat16
+        )
         messages = [
             {"role": "user", "content": prompt},
         ]
@@ -112,7 +115,7 @@ def test_model_generation(self):
             add_generation_prompt=True,
             return_tensors="pt",
         )
-        generated_ids = model.generate(tokenized_chat.to(model.device), max_new_tokens=30, top_k=1)
+        generated_ids = model.generate(tokenized_chat.to(model.device), max_new_tokens=10, top_k=1)
         text = tokenizer.decode(generated_ids[0])
         output = text.split("<think>")[1]
         self.assertEqual(EXPECTED_ANSWER, output)
Repository: vercel/next.js
Pull request: fix hidden errors in router-act

`createRouterAct` had a couple places where we create a promise via `new Promise(async (resolve) => { ... })` without accounting for the fact that some operations inside can throw, in which case the promise would never resolve. Some tests that use `createRouterAct` like to hang mysteriously, and i suspect this might be the reason. This PR changes those places to use an `(async () => { ... })()` IIFE instead.

Changed files:
filename: test/e2e/app-dir/segment-cache/router-act.ts
patch: @@ -159,7 +159,7 @@ export function createRouterAct(
             // `act` controls the timing of when responses reach the client,
             // but it should not affect the timing of when requests reach the
             // server; we pass the request to the server the immediately.
-            result: new Promise(async (resolve) => {
+            result: (async () => {
               const originalResponse = await page.request.fetch(request, {
                 maxRedirects: 0,
               })
@@ -172,13 +172,13 @@ export function createRouterAct(
               const headers = originalResponse.headers()
               delete headers['transfer-encoding']
 
-              resolve({
+              return {
                 text: await originalResponse.text(),
                 body: await originalResponse.body(),
                 headers,
                 status: originalResponse.status(),
-              })
-            }),
+              }
+            })(),
             didProcess: false,
           })
           if (onDidIssueFirstRequest !== null) {
@@ -417,14 +417,14 @@ ${fulfilled.body}
                     batch.pendingRequests.add({
                       url: req.url(),
                       route: null,
-                      result: new Promise(async (resolve) => {
-                        resolve({
+                      result: (async () => {
+                        return {
                           text: await res.text(),
                           body: await res.body(),
                           headers: res.headers(),
                           status: res.status(),
-                        })
-                      }),
+                        }
+                      })(),
                       didProcess: false,
                     })
                     page.off('response', handleResponse)
Repository: huggingface/transformers
Pull request: fix gemma3n case failure

# Problem
`pytest -rA tests/models/gemma3n/test_modeling_gemma3n.py::Gemma3nIntegrationTest::test_generation_beyond_sliding_window_with_generation_config` generate different output even `do_sample=False` in `generation_config = GenerationConfig(max_new_tokens=20, do_sample=False)`, which makes UT fails

# Root cause
custom generation_config will be overode by model generation_config even it explicitly set, when the set value equals global default.

# Fix
Add a condition to make the overriding only happens when the custom_generation_config doesn't explicitly set the field.  

@SunMarc , pls help review, thx very much.

Changed files:
filename: tests/models/gemma3n/test_modeling_gemma3n.py
patch: @@ -31,7 +31,6 @@
     Gemma3nAudioConfig,
     Gemma3nAudioFeatureExtractor,
     Gemma3nConfig,
-    GenerationConfig,
     StaticCache,
     is_torch_available,
 )
@@ -740,7 +739,7 @@ def setUp(self):
         audio_ds = load_dataset(
             "etechgrid/28.5k_wavfiles_dataset", "default", data_files="wav_dataset/103-1240-0000.wav"
         )
-        self.audio_file_path = audio_ds["train"][0]["audio"]["path"]
+        self.audio_file_path = audio_ds["train"][0]["audio"].metadata.path
         cleanup(torch_device, gc_collect=True)
 
     def tearDown(self):
@@ -988,15 +987,13 @@ def test_generation_beyond_sliding_window_with_generation_config(self):
         input_size = inputs.input_ids.shape[-1]
         self.assertTrue(input_size > model.config.get_text_config().sliding_window)
 
-        out = model.generate(**inputs, generation_config=GenerationConfig(max_new_tokens=20, do_sample=False))[
-            :, input_size:
-        ]
+        out = model.generate(**inputs, max_new_tokens=20, do_sample=False)[:, input_size:]
         output_text = tokenizer.batch_decode(out)
 
         EXPECTED_COMPLETIONS = Expectations({
             # FIXME: This test is VERY flaky on ROCm
             ("cuda", None): [" and I am glad to be here. This is a nice place. This is a nice place.", ", green, yellow, purple, orange, pink, brown, black, white.\n\nHere are"],
             ("rocm", (9, 4)): [' and I think it makes this place special. This is a nice place. This is a nice place', ', green, yellow, purple, orange, pink, brown, black, white.\n\nHere are'],
-            ("xpu", None): [" and I think it is very nice. I think it is nice. This is a nice place.", ", green, yellow, purple, orange, pink, brown, black, white.\n\nHere are"],
+            ("xpu", None): [" and I think it's a nice place to visit. This is a nice place. This is", ", green, yellow, orange, purple, pink, brown, black, white.\n\nHere'"],
         }).get_expectation()  # fmt: skip
         self.assertEqual(output_text, EXPECTED_COMPLETIONS)
Repository: ollama/ollama
Pull request: Remove trailing spaces

Remove trailing spaces in the bash scripts

Changed files:
filename: llm/generate/gen_common.sh
patch: @@ -21,7 +21,7 @@ init_vars() {
         # TODO - add additional optimization flags...
         CMAKE_DEFS="-DCMAKE_BUILD_TYPE=Release -DLLAMA_SERVER_VERBOSE=off ${CMAKE_DEFS}"
     fi
-    case $(uname -s) in 
+    case $(uname -s) in
     "Darwin")
         LIB_EXT="dylib"
         WHOLE_ARCHIVE="-Wl,-force_load"

filename: llm/generate/gen_linux.sh
patch: @@ -165,11 +165,11 @@ if [ -d "${CUDA_LIB_DIR}" ]; then
     fi
     if [ "${ARCH}" == "arm64" ]; then
         echo "ARM CPU detected - disabling unsupported AVX instructions"
-        
+
         # ARM-based CPUs such as M1 and Tegra do not support AVX extensions.
         #
-        # CUDA compute < 6.0 lacks proper FP16 support on ARM. 
-        # Disabling has minimal performance effect while maintaining compatibility. 
+        # CUDA compute < 6.0 lacks proper FP16 support on ARM.
+        # Disabling has minimal performance effect while maintaining compatibility.
         ARM64_DEFS="-DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_CUDA_F16=off"
     fi
     # Users building from source can tune the exact flags we pass to cmake for configuring llama.cpp
Repository: ggml-org/llama.cpp
Pull request: model-conversion : remove -fa option in model card template [no ci]

This commit updates the causal model card template and removes the `-fa` option as it is no longer required (fa is auto detected).



Changed files:
filename: examples/model-conversion/scripts/causal/modelcard.template
patch: @@ -7,7 +7,7 @@ base_model:
 Recommended way to run this model:
 
 ```sh
-llama-server -hf {namespace}/{model_name}-GGUF -c 0 -fa
+llama-server -hf {namespace}/{model_name}-GGUF -c 0
 ```
 
 Then, access http://localhost:8080
Repository: huggingface/transformers
Pull request: Allow optuna's catch kwargs passthrough

# What does this PR do?

Allow catch kwarg passthrough in Trainer.hyperparameter_search(backend="optuna") in order to expose Optuna’s Study.optimize(..., catch=...) argument by popping out catch kwargs before calling Optuna's study.optimize().

This PR addresss feature request #41463 

Changed files:
filename: src/transformers/integrations/integration_utils.py
patch: @@ -264,10 +264,13 @@ def _objective(trial: optuna.Trial, checkpoint_dir=None):
         timeout = kwargs.pop("timeout", None)
         n_jobs = kwargs.pop("n_jobs", 1)
         gc_after_trial = kwargs.pop("gc_after_trial", False)
+        catch = kwargs.pop("catch", ())
         directions = direction if isinstance(direction, list) else None
         direction = None if directions is not None else direction
         study = optuna.create_study(direction=direction, directions=directions, **kwargs)
-        study.optimize(_objective, n_trials=n_trials, timeout=timeout, n_jobs=n_jobs, gc_after_trial=gc_after_trial)
+        study.optimize(
+            _objective, n_trials=n_trials, timeout=timeout, n_jobs=n_jobs, gc_after_trial=gc_after_trial, catch=catch
+        )
         if not study._is_multi_objective():
             best_trial = study.best_trial
             return BestRun(str(best_trial.number), best_trial.value, best_trial.params)
Repository: denoland/deno
Pull request: fix: normalize `capture` to boolean in `removeEventListener` options

- [x] Fix `normalizeEventHandlerOptions` in `ext/web/02_event.js` to properly normalize `capture` to a boolean when options is an object (e.g. `{}`)
- [x] Add test in `tests/unit/event_test.ts` verifying `removeEventListener` works with empty object options
- [x] Verify fix works and existing tests pass (28/28 pass)

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>removeEventListener fails to remove event handler if empty object option is specified</issue_title>
> <issue_description>```js
> const target = new EventTarget();
> target.addEventListener("foo", console.log)
> target.removeEventListener("foo", console.log, {})
> target.dispatchEvent(new Event("foo"));
> ```
> 
> This prints `foo` Event object (which means `removeEventListener` didn't work).
> 
> This happens because `normalizeEventHandlerOptions` in `ext/web/02_event.js` doesn't correctly normalize the options object.</issue_description>
> 
> <agent_instructions>Add a test in `tests/unit/event_test.ts`. The implementation for `Event` is in `ext/web/02_event.js`.</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes denoland/deno#29681

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/denoland/deno/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.


Changed files:
filename: ext/web/02_event.js
patch: @@ -830,6 +830,7 @@ function invokeEventListeners(tuple, eventImpl) {
   }
 }
 
+// https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener
 function normalizeEventHandlerOptions(
   options,
 ) {
@@ -838,7 +839,9 @@ function normalizeEventHandlerOptions(
       capture: Boolean(options),
     };
   } else {
-    return options;
+    return {
+      capture: Boolean(options.capture),
+    };
   }
 }
 

filename: tests/unit/event_test.ts
patch: @@ -142,6 +142,19 @@ Deno.test(function inspectEvent() {
   );
 });
 
+Deno.test(function removeEventListenerWithEmptyObjectOptions() {
+  const target = new EventTarget();
+  let callCount = 0;
+  const listener = () => {
+    callCount++;
+  };
+
+  target.addEventListener("foo", listener);
+  target.removeEventListener("foo", listener, {});
+  target.dispatchEvent(new Event("foo"));
+  assertEquals(callCount, 0);
+});
+
 Deno.test("default argument is null prototype", () => {
   const event = new Event("test");
   assertEquals(event.bubbles, false);