helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: fix: Buffer global in --unstable-node-globals


Changed files:
filename: runtime/js/98_global_scope_shared.js
patch: @@ -32,7 +32,7 @@ import { DOMException } from "ext:deno_web/01_dom_exception.js";
 import * as abortSignal from "ext:deno_web/03_abort_signal.js";
 import * as imageData from "ext:deno_web/16_image_data.js";
 import process from "node:process";
-import Buffer from "node:buffer";
+import { Buffer } from "node:buffer";
 import { clearImmediate, setImmediate } from "node:timers";
 import { loadWebGPU } from "ext:deno_webgpu/00_init.js";
 import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";

filename: tests/specs/run/unstable/node_globals.out
patch: @@ -1,4 +1,10 @@
 global: true
-Buffer: true
+Buffer: function from(
+  value,
+  encodingOrOffset,
+  length,
+) {
+  return _from(value, encodingOrOffset, length);
+}
 setImmediate: true
 clearImmediate: true

filename: tests/specs/run/unstable/node_globals.ts
patch: @@ -2,6 +2,6 @@ import * as nodeBuffer from "node:buffer";
 import * as nodeTimers from "node:timers";
 
 console.log(`global: ${globalThis === global}`);
-console.log(`Buffer: ${Buffer === nodeBuffer.default}`);
+console.log(`Buffer: ${Buffer.from}`);
 console.log(`setImmediate: ${setImmediate === nodeTimers.setImmediate}`);
 console.log(`clearImmediate: ${clearImmediate === nodeTimers.clearImmediate}`);
Repository: ggml-org/llama.cpp
Pull request: Move the graph placeholder message to debug mode

Without that condition, this debug log clutters the screen every batch treated in the prompt processing, or every token generated in Kobold.cpp.


Changed files:
filename: src/llama-graph.cpp
patch: @@ -467,7 +467,9 @@ bool llm_graph_result::can_reuse(const llm_graph_params & params) {
     for (auto & input : inputs) {
         const bool cur = input->can_reuse(params);
 
-        LLAMA_LOG_DEBUG("  %s: can_reuse = %d\n", "placeholder", cur);
+        if (debug > 1) {
+            LLAMA_LOG_DEBUG("%s: can_reuse = %d\n", "placeholder", cur);
+        }
 
         res = res && cur;
     }
Repository: ggml-org/llama.cpp
Pull request: ci : remove cuda 11.7 releases, switch runner to windows 2022

CUDA 11.7 does not work in the windows 2022 runners, and the windows 2019 runners are being removed. At this point I don't think the 11.7 releases are necessary, everybody should already have a driver compatible with CUDA 12.

Changed files:
filename: .github/workflows/build.yml
patch: @@ -839,12 +839,12 @@ jobs:
               -DGGML_CUDA=ON
             cmake --build build
 
-  windows-2019-cmake-cuda:
-    runs-on: windows-2019
+  windows-2022-cmake-cuda:
+    runs-on: windows-2022
 
     strategy:
       matrix:
-        cuda: ['12.4', '11.7']
+        cuda: ['12.4']
 
     steps:
       - name: Clone
@@ -878,7 +878,7 @@ jobs:
         env:
           CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
         run: |
-          call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
+          call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
           cmake -S . -B build -G "Ninja Multi-Config" ^
             -DLLAMA_BUILD_SERVER=ON ^
             -DGGML_NATIVE=OFF ^

filename: .github/workflows/release.yml
patch: @@ -380,11 +380,11 @@ jobs:
           name: llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip
 
   windows-cuda:
-    runs-on: windows-2019
+    runs-on: windows-2022
 
     strategy:
       matrix:
-        cuda: ['12.4', '11.7']
+        cuda: ['12.4']
 
     steps:
       - name: Clone
@@ -412,7 +412,7 @@ jobs:
         id: cmake_build
         shell: cmd
         run: |
-          call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
+          call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
           cmake -S . -B build -G "Ninja Multi-Config" ^
             -DGGML_BACKEND_DL=ON ^
             -DGGML_NATIVE=OFF ^

filename: .github/workflows/server.yml
patch: @@ -180,7 +180,7 @@ jobs:
 
 
   server-windows:
-    runs-on: windows-2019
+    runs-on: windows-2022
 
     steps:
       - name: Clone
Repository: electron/electron
Pull request: build: remove unused lint package

Backport of #44525

See that PR for details.


Notes: none <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->


Changed files:
filename: package.json
patch: @@ -40,7 +40,6 @@
     "folder-hash": "^2.1.1",
     "got": "^11.8.5",
     "husky": "^8.0.1",
-    "lint": "^1.1.2",
     "lint-staged": "^10.2.11",
     "minimist": "^1.2.8",
     "null-loader": "^4.0.1",

filename: yarn.lock
patch: @@ -4385,11 +4385,6 @@ lint-staged@^10.2.11:
     string-argv "0.3.1"
     stringify-object "^3.3.0"
 
-lint@^1.1.2:
-  version "1.1.2"
-  resolved "https://registry.yarnpkg.com/lint/-/lint-1.1.2.tgz#35ed064f322547c331358d899868664968ba371f"
-  integrity sha1-Ne0GTzIlR8MxNY2JmGhmSWi6Nx8=
-
 listr2@^2.1.0:
   version "2.2.0"
   resolved "https://registry.yarnpkg.com/listr2/-/listr2-2.2.0.tgz#cb88631258abc578c7fb64e590fe5742f28e4aac"
Repository: huggingface/transformers
Pull request: Pin Scipy version to >=1.12.0

# What does this PR do?

Pins Scippy to fix the batch of `TypeError: gaussian_filter() got an unexpected keyword argument 'axes'` issues.


Changed files:
filename: setup.py
patch: @@ -172,7 +172,7 @@
     "sagemaker>=2.31.0",
     "schedulefree>=1.2.6",
     "scikit-learn",
-    "scipy<1.13.0",  # SciPy >= 1.13.0 is not supported with the current jax pin (`jax>=0.4.1,<=0.4.13`)
+    "scipy<1.13.0,>=1.12.0",  # SciPy >= 1.13.0 is not supported with the current jax pin (`jax>=0.4.1,<=0.4.13`)
     "sentencepiece>=0.1.91,!=0.1.92",
     "sigopt",
     "starlette",

filename: src/transformers/dependency_versions_table.py
patch: @@ -75,7 +75,7 @@
     "sagemaker": "sagemaker>=2.31.0",
     "schedulefree": "schedulefree>=1.2.6",
     "scikit-learn": "scikit-learn",
-    "scipy": "scipy<1.13.0",
+    "scipy": "scipy<1.13.0,>=1.12.0",
     "sentencepiece": "sentencepiece>=0.1.91,!=0.1.92",
     "sigopt": "sigopt",
     "starlette": "starlette",
Repository: ggml-org/llama.cpp
Pull request: model : fix build after merge conflict

ref #14630 + #14629

Changed files:
filename: src/llama-model.cpp
patch: @@ -13530,7 +13530,7 @@ struct llm_build_exaone : public llm_graph_context {
 
 template <bool iswa>
 struct llm_build_exaone4 : public llm_graph_context {
-    llm_build_exaone4(const llama_model & model, const llm_graph_params & params, ggml_cgraph * gf) : llm_graph_context(params) {
+    llm_build_exaone4(const llama_model & model, const llm_graph_params & params) : llm_graph_context(params) {
         const int64_t n_embd_head = hparams.n_embd_head_k;
 
         GGML_ASSERT(n_embd_head == hparams.n_embd_head_v);
@@ -13603,7 +13603,7 @@ struct llm_build_exaone4 : public llm_graph_context {
                 cb(Kcur, "Kcur", il);
                 cb(Vcur, "Vcur", il);
 
-                cur = build_attn(inp_attn, gf,
+                cur = build_attn(inp_attn,
                         model.layers[il].wo, NULL,
                         Qcur, Kcur, Vcur, nullptr, nullptr, 1.0f/sqrtf(float(n_embd_head)), il);
                 cb(cur, "attn_out", il);
@@ -17352,9 +17352,9 @@ ggml_cgraph * llama_model::build_graph(const llm_graph_params & params) const {
         case LLM_ARCH_EXAONE4:
             {
                 if (hparams.swa_type == LLAMA_SWA_TYPE_STANDARD) {
-                    llm = std::make_unique<llm_build_exaone4<true>>(*this, params, gf);
+                    llm = std::make_unique<llm_build_exaone4<true>>(*this, params);
                 } else {
-                    llm = std::make_unique<llm_build_exaone4<false>>(*this, params, gf);
+                    llm = std::make_unique<llm_build_exaone4<false>>(*this, params);
                 }
             } break;
         case LLM_ARCH_RWKV6:
Repository: nodejs/node
Pull request: doc: clarify path.isAbsolute is not enough for mitigating path traversals

Since `path.isAbsolute()` it’s likely used for mitigating path traversals, I’m documentating that it doesn’t resolve paths.

I didn’t test its usages but for example it looks that it’s used for that here: https://github.com/nodejs/node/blob/47ae886e43537365ccc54beff0b1ac08a5a5aa19/lib/fs.js#L1803C3-L1815C4

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/path.md
patch: @@ -317,17 +317,19 @@ added: v0.11.2
 * `path` {string}
 * Returns: {boolean}
 
-The `path.isAbsolute()` method determines if `path` is an absolute path.
+The `path.isAbsolute()` method determines if the literal `path` is absolute.
+Therefore, it’s not safe for mitigating path traversals.
 
 If the given `path` is a zero-length string, `false` will be returned.
 
 For example, on POSIX:
 
 ```js
-path.isAbsolute('/foo/bar'); // true
-path.isAbsolute('/baz/..');  // true
-path.isAbsolute('qux/');     // false
-path.isAbsolute('.');        // false
+path.isAbsolute('/foo/bar');   // true
+path.isAbsolute('/baz/..');    // true
+path.isAbsolute('/baz/../..'); // true
+path.isAbsolute('qux/');       // false
+path.isAbsolute('.');          // false
 ```
 
 On Windows:
Repository: denoland/deno
Pull request: fix(watch): don't panic if there's no path provided

Closes https://github.com/denoland/deno/issues/26970

Changed files:
filename: cli/util/file_watcher.rs
patch: @@ -185,9 +185,11 @@ impl WatcherCommunicator {
 
   pub fn show_path_changed(&self, changed_paths: Option<Vec<PathBuf>>) {
     if let Some(paths) = changed_paths {
-      self.print(
-        format!("Restarting! File change detected: {:?}", paths[0]).to_string(),
-      )
+      if !paths.is_empty() {
+        self.print(format!("Restarting! File change detected: {:?}", paths[0]))
+      } else {
+        self.print("Restarting! File change detected.".to_string())
+      }
     }
   }
 }
Repository: denoland/deno
Pull request: fix(cli): Fixed missing subcommands and typo in deno --help

Added completions, lsp and types to the list of subcommands in the deno --help command. Also fixed small typo.
Issue: https://github.com/denoland/deno/issues/26096



Changed files:
filename: cli/args/flags.rs
patch: @@ -1232,7 +1232,7 @@ static DENO_HELP: &str = cstr!(
     <g>compile</>      Compile the script into a self contained executable
                   <p(245)>deno compile main.ts  |  deno compile --target=x86_64-unknown-linux-gnu</>
     <g>coverage</>     Print coverage reports
-    <g>doc</>          Genereate and show documentation for a module or built-ins
+    <g>doc</>          Generate and show documentation for a module or built-ins
                   <p(245)>deno doc  |  deno doc --json  |  deno doc --html mod.ts</>
     <g>fmt</>          Format source files
                   <p(245)>deno fmt  |  deno fmt main.ts</>

filename: tests/integration/flags_tests.rs
patch: @@ -24,7 +24,7 @@ fn help_output() {
     "Type-check the dependencies",
     "Compile the script into a self contained executable",
     "Print coverage reports",
-    "Genereate and show documentation for a module or built-ins",
+    "Generate and show documentation for a module or built-ins",
     "Format source files",
     "Show info about cache or info related to source file",
     "Deno kernel for Jupyter notebooks",
Repository: electron/electron
Pull request: build: remove unused lint package

#### Description of Change

I doubt this package has been in use in a long time, so let's go ahead and jettison it, especially since it's confusingly named with our lint scripts.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd

#### Release Notes

Notes: none <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->


Changed files:
filename: package.json
patch: @@ -39,7 +39,6 @@
     "folder-hash": "^2.1.1",
     "got": "^11.8.5",
     "husky": "^8.0.1",
-    "lint": "^1.1.2",
     "lint-staged": "^10.2.11",
     "markdownlint-cli2": "^0.13.0",
     "minimist": "^1.2.8",

filename: yarn.lock
patch: @@ -4199,11 +4199,6 @@ lint-staged@^10.2.11:
     string-argv "0.3.1"
     stringify-object "^3.3.0"
 
-lint@^1.1.2:
-  version "1.1.2"
-  resolved "https://registry.yarnpkg.com/lint/-/lint-1.1.2.tgz#35ed064f322547c331358d899868664968ba371f"
-  integrity sha1-Ne0GTzIlR8MxNY2JmGhmSWi6Nx8=
-
 listr2@^2.1.0:
   version "2.2.0"
   resolved "https://registry.yarnpkg.com/listr2/-/listr2-2.2.0.tgz#cb88631258abc578c7fb64e590fe5742f28e4aac"
Repository: ggml-org/llama.cpp
Pull request: use max work group size for device to replace the magic number

Fix issue https://github.com/ggml-org/llama.cpp/issues/14689
use max work group size for device to replace the magic number.
The magic number 768 is copied from CUDA code.

It will lead to issue "invalid work-group size" on Intel iGPU with less work group size.

Changed files:
filename: ggml/src/ggml-sycl/ggml-sycl.cpp
patch: @@ -3530,8 +3530,11 @@ static void ggml_sycl_mul_mat_id(ggml_backend_sycl_context & ctx,
             SYCL_CHECK(CHECK_TRY_ERROR(
                 stream->memset(dev_cur_src1_row.get(), 0, sizeof(int))));
 
+            const unsigned int max_work_group_size = ggml_sycl_info().max_work_group_sizes[ctx.device];
+            assert(work_group_size % (WARP_SIZE * WARP_SIZE) == 0);
+
             {
-                sycl::range<3> block_dims(1, 1, std::min((unsigned int)ne10, 768u));
+                sycl::range<3> block_dims(1, 1, std::min((unsigned int)ne10, max_work_group_size));
                 sycl::range<3> grid_dims(1, n_ids, ids->ne[1]);
                 sycl_launch(stream, [&](sycl::handler & cgh) {
                     sycl::local_accessor<int, 0> src1_row_acc(cgh);
@@ -3575,7 +3578,7 @@ static void ggml_sycl_mul_mat_id(ggml_backend_sycl_context & ctx,
             ggml_sycl_mul_mat(ctx, &src0_row, &src1_row, &dst_row);
 
             {
-                sycl::range<3> block_dims(1, 1, std::min((unsigned int)ne0, 768u));
+                sycl::range<3> block_dims(1, 1, std::min((unsigned int)ne0, max_work_group_size));
                 sycl::range<3> grid_dims(1, 1, num_src1_rows);
                 sycl_launch(stream, [&](sycl::handler & cgh) {
                     const char *__restrict dst_contiguous_get =
Repository: vercel/next.js
Pull request: Remove unused vendored `server-inserted-metadata` module

Follow-up to https://github.com/vercel/next.js/pull/78495

Found with the help of https://github.com/vercel/next.js/pull/80056: https://github.com/vercel/next.js/actions/runs/15436434717/job/43443835635?pr=80056#step:8:505

Changed files:
filename: packages/next/src/server/route-modules/app-page/vendored/contexts/server-inserted-metadata.ts
patch: @@ -1,3 +0,0 @@
-module.exports = require('../../module.compiled').vendored[
-  'contexts'
-].ServerInsertedMetadata
Repository: ggml-org/llama.cpp
Pull request: Fix Ernie4.5 MoE without shared experts

Fix bug per discussion in https://github.com/ggml-org/llama.cpp/pull/14658

Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -2910,11 +2910,12 @@ def set_gguf_parameters(self):
         self.gguf_writer.add_expert_used_count(self.hparams["moe_k"])
         self.gguf_writer.add_interleave_moe_layer_step(self.hparams["moe_layer_interval"])
         self.gguf_writer.add_leading_dense_block_count(self.hparams["moe_layer_start_index"])
-        self.gguf_writer.add_rope_freq_base(self.hparams["rope_theta"])
         if (moe_intermediate_size := self.hparams.get("moe_intermediate_size")) is not None:
             self.gguf_writer.add_expert_feed_forward_length(moe_intermediate_size)
-        if (shared_expert_intermediate_size := self.hparams.get('intermediate_size')) is not None and (num_key_value_heads := self.hparams.get('num_key_value_heads')) is not None:
-            self.gguf_writer.add_expert_shared_feed_forward_length(shared_expert_intermediate_size // num_key_value_heads)
+        if (shared_expert_count := self.hparams.get('moe_num_shared_experts')) is not None:
+            self.gguf_writer.add_expert_shared_count(shared_expert_count)
+            if shared_expert_count > 0 and (shared_expert_intermediate_size := self.hparams.get('intermediate_size')) is not None and (num_key_value_heads := self.hparams.get('num_key_value_heads')) is not None:
+                self.gguf_writer.add_expert_shared_feed_forward_length(shared_expert_intermediate_size // num_key_value_heads)
 
     def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
         # Modify correction bias name as in DeepseekV2
Repository: facebook/react
Pull request: Revert "Fork ReactDOMSharedInternals for www (#25791)"

We did some cleanup internally of our ReactDOM module, so this fork should be safe to remove now. Will land this only after our internal diff lands.

Changed files:
filename: packages/shared/forks/ReactDOMSharedInternals.www.js
patch: @@ -1,16 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow
- */
-
-// $FlowIgnore[cannot-resolve-module] provided by www
-const ReactDOM = require('ReactDOMComet');
-
-const ReactDOMSharedInternals =
-  ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
-
-export default ReactDOMSharedInternals;

filename: scripts/rollup/forks.js
patch: @@ -70,14 +70,6 @@ const forks = Object.freeze({
     if (entry === 'react-dom' || entry === 'react-dom/server-rendering-stub') {
       return './packages/react-dom/src/ReactDOMSharedInternals.js';
     }
-    switch (bundleType) {
-      case FB_WWW_DEV:
-      case FB_WWW_PROD:
-      case FB_WWW_PROFILING:
-        return './packages/shared/forks/ReactDOMSharedInternals.www.js';
-      default:
-        break;
-    }
     if (
       !entry.startsWith('react-dom/') &&
       dependencies.indexOf('react-dom') === -1
Repository: huggingface/transformers
Pull request: update `utils/notification_service.py` for AMD vs Nvidia

# What does this PR do?

As discussed with @mht-sharma 

Changed files:
filename: utils/get_previous_daily_ci.py
patch: @@ -57,8 +57,8 @@ def get_last_daily_ci_run(token, workflow_run_id=None, workflow_id=None, commit_
         if commit_sha in [None, ""] and run["status"] == "completed":
             workflow_run = run
             break
-        # if `commit_sha` is specified, and `workflow_run["head_sha"]` matches it, return it.
-        elif commit_sha not in [None, ""] and run["head_sha"] == commit_sha:
+        # if `commit_sha` is specified, return the latest completed run with `workflow_run["head_sha"]` matching the specified sha.
+        elif commit_sha not in [None, ""] and run["head_sha"] == commit_sha and run["status"] == "completed":
             workflow_run = run
             break
Repository: vercel/next.js
Pull request: Webpack Build: Use name-contenthash instead of name-chunkhash for dynamic imports

Did a bit of digging into #78756. It seems we already read the file paths correctly, just needed to check it later in asset processing hook.

Closes PACK-4768

Changed files:
filename: packages/next/src/build/webpack-config.ts
patch: @@ -1281,7 +1281,7 @@ export default async function getBaseWebpackConfig(
           ? `[name].js`
           : `../[name].js`
         : `static/chunks/${isDevFallback ? 'fallback/' : ''}[name]${
-            dev ? '' : appDir ? '-[chunkhash]' : '-[contenthash]'
+            dev ? '' : '-[contenthash]'
           }.js`,
       library: isClient || isEdgeServer ? '_N_E' : undefined,
       libraryTarget: isClient || isEdgeServer ? 'assign' : 'commonjs2',

filename: packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts
patch: @@ -128,9 +128,6 @@ function getAppPathRequiredChunks(
     }
 
     // Get the actual chunk file names from the chunk file list.
-    // It's possible that the chunk is generated via `import()`, in
-    // that case the chunk file name will be '[name].[contenthash]'
-    // instead of '[name]-[chunkhash]'.
     if (chunk.id != null) {
       const chunkId = '' + chunk.id
       chunk.files.forEach((file) => {
@@ -229,7 +226,7 @@ export class ClientReferenceManifestPlugin {
           name: PLUGIN_NAME,
           // Have to be in the optimize stage to run after updating the CSS
           // asset hash via extract mini css plugin.
-          stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,
+          stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ANALYSE,
         },
         () => this.createAsset(compilation, compiler.context)
       )
Repository: nodejs/node
Pull request: timers: check for immediate instance in clearImmediate

Fixes https://github.com/nodejs/node/issues/57063

Changed files:
filename: lib/timers.js
patch: @@ -301,7 +301,7 @@ ObjectDefineProperty(setImmediate, customPromisify, {
  * @returns {void}
  */
 function clearImmediate(immediate) {
-  if (!immediate || immediate._destroyed)
+  if (!immediate?._onImmediate || immediate._destroyed)
     return;
 
   immediateInfo[kCount]--;

filename: test/parallel/test-timers-invalid-clear.js
patch: @@ -0,0 +1,13 @@
+'use strict';
+
+const common = require('../common');
+
+// clearImmediate should be a noop if anything other than an Immediate
+// is passed to it.
+
+const t = setTimeout(common.mustCall());
+
+clearImmediate(t);
+
+setTimeout(common.mustCall());
+setTimeout(common.mustCall());