helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: llama : rename batch_all to batch

This commit addresses the TODO in the code to rename the `batch_all` parameter to `batch` in `llama_decode_internal`.



- [x] I have read the [contributing guidelines](https://github.com/ggerganov/llama.cpp/blob/master/CONTRIBUTING.md)
- Self-reported review complexity:
  - [x] Low
  - [ ] Medium
  - [ ] High


Changed files:
filename: src/llama.cpp
patch: @@ -17134,10 +17134,10 @@ static void llama_graph_compute(
 //
 static int llama_decode_internal(
          llama_context & lctx,
-           llama_batch   batch_all) { // TODO: rename back to batch
+           llama_batch   batch) {
 
     lctx.is_encoding = false;
-    const uint32_t n_tokens_all = batch_all.n_tokens;
+    const uint32_t n_tokens_all = batch.n_tokens;
 
     if (n_tokens_all == 0) {
         LLAMA_LOG_ERROR("%s: n_tokens == 0\n", __func__);
@@ -17148,12 +17148,12 @@ static int llama_decode_internal(
     const auto & hparams = model.hparams;
     const auto & cparams = lctx.cparams;
 
-    GGML_ASSERT((!batch_all.token && batch_all.embd) || (batch_all.token && !batch_all.embd)); // NOLINT
+    GGML_ASSERT((!batch.token && batch.embd) || (batch.token && !batch.embd)); // NOLINT
 
-    if (batch_all.token) {
+    if (batch.token) {
         for (uint32_t i = 0; i < n_tokens_all; ++i) {
-            if (batch_all.token[i] < 0 || (uint32_t)batch_all.token[i] >= model.vocab.n_vocab) {
-                LLAMA_LOG_ERROR("%s: invalid token[%d] = %d\n", __func__, i, batch_all.token[i]);
+            if (batch.token[i] < 0 || (uint32_t)batch.token[i] >= model.vocab.n_vocab) {
+                LLAMA_LOG_ERROR("%s: invalid token[%d] = %d\n", __func__, i, batch.token[i]);
                 return -1;
             }
         }
@@ -17184,9 +17184,9 @@ static int llama_decode_internal(
     lctx.embd_seq.clear();
 
     // count outputs
-    if (batch_all.logits && !embd_pooled) {
+    if (batch.logits && !embd_pooled) {
         for (uint32_t i = 0; i < n_tokens_all; ++i) {
-            n_outputs += batch_all.logits[i] != 0;
+            n_outputs += batch.logits[i] != 0;
         }
     } else if (lctx.logits_all || embd_pooled) {
         n_outputs = n_tokens_all;
@@ -17195,7 +17195,7 @@ static int llama_decode_internal(
         n_outputs = 1;
     }
 
-    lctx.sbatch.from_batch(batch_all, n_embd,
+    lctx.sbatch.from_batch(batch, n_embd,
         /* simple_split */ !kv_self.recurrent,
         /* logits_all   */ n_outputs == n_tokens_all);
Repository: vercel/next.js
Pull request: fix: server actions should fetch from the router canonicalUrl

A test related to navigation + server action handling was frequently flaking in CI ([x-ref](https://github.com/vercel/next.js/actions/runs/15746992788/job/44386768835#step:34:2634)). When simulating a 20x browser slowdown, it's fairly easy to reproduce the failure case as well.

The failure occurs due to a race where the router will invoke the server action against the page the user was on _before_ the navigation, but _after_ the navigation action has been processed. As a result, the RSC payload associated with the target page gets replaced by the RSC payload returned from the server action. There exists a window of time where `window.location.pathname` is still referring to the previous URL while `routerState.canonicalUrl` would have been updated to the new page.

This revealed two things:
- The behavior being tested here only tests the expected behavior some of the time: when it failed, it meant the action wasn't actually forwarded (not currently addressed by this PR)
- The router state should be the source of truth when determining the URL to fetch from

Changed files:
filename: packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts
patch: @@ -87,7 +87,7 @@ async function fetchServerAction(
 
   const body = await encodeReply(usedArgs, { temporaryReferences })
 
-  const res = await fetch('', {
+  const res = await fetch(state.canonicalUrl, {
     method: 'POST',
     headers: {
       Accept: RSC_CONTENT_TYPE_HEADER,

filename: test/e2e/app-dir/actions/app-action.test.ts
patch: @@ -898,13 +898,6 @@ describe('app-dir action handling', () => {
         .elementByCss(`[href='/delayed-action/${runtime}/other']`)
         .click()
 
-      // wait for url to change
-      await retry(async () => {
-        expect(await browser.url()).toBe(
-          `${next.url}/delayed-action/${runtime}/other`
-        )
-      })
-
       await browser.waitForElementByCss('#other-page')
 
       await retry(async () => {
Repository: huggingface/transformers
Pull request: Correctly raise error for awq quantization

# What does this PR do?

Without it, the following would run correctly:

```python
from transformers import AutoModelForCausalLM
import torch

model_id = "hugging-quants/Meta-Llama-3.1-8B-Instruct-AWQ-INT4"
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="cpu", torch_dtype=torch.bfloat16)
```

and crash later during forward, whereas it should actually fail early

cc @MekkCyber @SunMarc for viz

Changed files:
filename: src/transformers/quantizers/quantizer_awq.py
patch: @@ -82,7 +82,9 @@ def validate_environment(self, device_map, **kwargs):
                     "your model on a GPU device in order to run your model."
                 )
             elif device_map is not None:
-                if isinstance(device_map, dict) and ("cpu" in device_map.values() or "disk" in device_map.values()):
+                if isinstance(device_map, dict) and any(
+                    forbidden in device_map.values() for forbidden in ("cpu", torch.device("cpu"), "disk")
+                ):
                     raise ValueError(
                         "You are attempting to load an AWQ model with a device_map that contains a CPU or disk device."
                         " This is not supported. Please remove the CPU or disk device from the device_map."
Repository: facebook/react
Pull request: (patch)[DevTools] bug fix: backend injection logic not working for undocked devtools window

bugfix for #26492

This bug would cause users unable to use the devtools (component tree empty).

The else-if logic is broken when user switch to undocked devtools mode (separate window) because `sender.tab` would exist in that case.
<img width="314" alt="image" src="https://user-images.githubusercontent.com/1001890/232930094-05a74445-9189-4d50-baf1-a0360b29ef7e.png">

Tested on Chrome with a local build

Changed files:
filename: packages/react-devtools-extensions/src/background.js
patch: @@ -172,6 +172,7 @@ chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
 
 chrome.runtime.onMessage.addListener((request, sender) => {
   const tab = sender.tab;
+  // sender.tab.id from content script points to the tab that injected the content script
   if (tab) {
     const id = tab.id;
     // This is sent from the hook content script.
@@ -214,7 +215,10 @@ chrome.runtime.onMessage.addListener((request, sender) => {
           break;
       }
     }
-  } else if (request.payload?.tabId) {
+  }
+  // sender.tab.id from devtools page may not exist, or point to the undocked devtools window
+  // so we use the payload to get the tab id
+  if (request.payload?.tabId) {
     const tabId = request.payload?.tabId;
     // This is sent from the devtools page when it is ready for injecting the backend
     if (request.payload.type === 'react-devtools-inject-backend-manager') {
Repository: electron/electron
Pull request: build: update appveyor image to latest version

This PR updates appveyor.yml to the latest baked image, e-133.0.6852.0.

Notes: none

Changed files:
filename: appveyor-woa.yml
patch: @@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-133.0.6846.0
+image: e-133.0.6852.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default

filename: appveyor.yml
patch: @@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-133.0.6846.0
+image: e-133.0.6852.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default
Repository: ggml-org/llama.cpp
Pull request: xcf : add check for visionos build version

This commit adds a check for the visionos build version used with vtool in build-xcframework.sh. The script now checks the Xcode version and determines whether to use "xros" or "visionos" for the build version.

This commit also uses xcrun for the vtool so that the version of vtool in xcode command line tools is used instead of the one in the system path.

Refs: https://github.com/ggml-org/whisper.cpp/pull/2994#issuecomment-2773292223


Changed files:
filename: build-xcframework.sh
patch: @@ -41,6 +41,11 @@ COMMON_CMAKE_ARGS=(
     -DGGML_OPENMP=${GGML_OPENMP}
 )
 
+XCODE_VERSION=$(xcodebuild -version 2>/dev/null | head -n1 | awk '{ print $2 }')
+MAJOR_VERSION=$(echo $XCODE_VERSION | cut -d. -f1)
+MINOR_VERSION=$(echo $XCODE_VERSION | cut -d. -f2)
+echo "Detected Xcode version: $XCODE_VERSION"
+
 check_required_tool() {
     local tool=$1
     local install_message=$2
@@ -325,21 +330,28 @@ combine_static_libraries() {
 
     # Platform-specific post-processing for device builds
     if [[ "$is_simulator" == "false" ]]; then
-        if command -v vtool &>/dev/null; then
+        if command -v xcrun vtool &>/dev/null; then
             case "$platform" in
                 "ios")
                     echo "Marking binary as a framework binary for iOS..."
-                    vtool -set-build-version ios ${IOS_MIN_OS_VERSION} ${IOS_MIN_OS_VERSION} -replace \
+                    xcrun vtool -set-build-version ios ${IOS_MIN_OS_VERSION} ${IOS_MIN_OS_VERSION} -replace \
                         -output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
                     ;;
                 "visionos")
                     echo "Marking binary as a framework binary for visionOS..."
-                    vtool -set-build-version xros ${VISIONOS_MIN_OS_VERSION} ${VISIONOS_MIN_OS_VERSION} -replace \
+                    if [[ "$MAJOR_VERSION" -gt 16 ]] || [[ "$MAJOR_VERSION" -eq 16 && "$MINOR_VERSION" -gt 2 ]]; then
+                        echo "Xcode version greater than 16.2, using visionOS."
+                        VISION_OS_BUILD_VERSION="visionos"
+                    else
+                        echo "Xcode version less than or equal to 16.2, using xros."
+                        VISION_OS_BUILD_VERSION="xros"
+                    fi
+                    xcrun vtool -set-build-version ${VISION_OS_BUILD_VERSION} ${VISIONOS_MIN_OS_VERSION} ${VISIONOS_MIN_OS_VERSION} -replace \
                         -output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
                     ;;
                 "tvos")
                     echo "Marking binary as a framework binary for tvOS..."
-                    vtool -set-build-version tvos ${TVOS_MIN_OS_VERSION} ${TVOS_MIN_OS_VERSION} -replace \
+                    xcrun vtool -set-build-version tvos ${TVOS_MIN_OS_VERSION} ${TVOS_MIN_OS_VERSION} -replace \
                         -output "${base_dir}/${output_lib}" "${base_dir}/${output_lib}"
                     ;;
             esac
Repository: denoland/deno
Pull request: fix(init): correct dev task for --lib

Was wrong:

```
Task dev deno test --watch mod.ts
Watcher Test started.
running 0 tests from ./mod.ts

ok | 0 passed | 0 failed (2ms)

Watcher Test finished. Restarting on file change...
```

Changed files:
filename: cli/tools/init/mod.rs
patch: @@ -158,7 +158,7 @@ Deno.test(function addTest() {
         "version": "0.1.0",
         "exports": "./mod.ts",
         "tasks": {
-          "dev": "deno test --watch mod.ts"
+          "dev": "deno test --watch"
         },
         "license": "MIT",
         "imports": {
Repository: vercel/next.js
Pull request: Revert "(E2E) Log which config file is used for `next start`"

Reverts vercel/next.js#73105

Changed files:
filename: packages/next/src/server/config.ts
patch: @@ -1214,14 +1214,6 @@ export default async function loadConfig(
 
   const path = await findUp(CONFIG_FILES, { cwd: dir })
 
-  if (process.env.__NEXT_TEST_MODE) {
-    if (path) {
-      Log.info(`Loading config from ${path}`)
-    } else {
-      Log.info('No config file found')
-    }
-  }
-
   // If config file was found
   if (path?.length) {
     configFileName = basename(path)

filename: test/integration/cli/test/index.test.js
patch: @@ -659,6 +659,7 @@ describe('CLI Usage', () => {
       expect(stdout).not.toMatch(/ready/i)
       expect(stdout).not.toMatch('started')
       expect(stdout).not.toMatch(`${port}`)
+      expect(stripAnsi(stdout).trim()).toBeFalsy()
     })
 
     test('Allow retry if default port is already in use', async () => {

filename: test/integration/edge-runtime-configurable-guards/next.config.js
patch: @@ -1 +0,0 @@
-module.exports = {}
Repository: nodejs/node
Pull request: doc: mention reports should align with Node.js CoC

Refs: https://github.com/nodejs/moderation/issues/830

cc: @nodejs/security @nodejs/tsc 


Once approved I can also update H1 content (which is a mirror of SECURITY.md)

Changed files:
filename: SECURITY.md
patch: @@ -55,6 +55,39 @@ Here is the security disclosure policy for Node.js
   possible; however, we must follow the release process above to ensure that we
   handle disclosure consistently.
 
+## Code of Conduct and Vulnerability Reporting Guidelines
+
+When reporting security vulnerabilities, reporters must adhere to the following guidelines:
+
+1. **Code of Conduct Compliance**: All security reports must comply with our
+   [Code of Conduct](CODE_OF_CONDUCT.md). Reports that violate our code of conduct
+   will not be considered and may result in being banned from future participation.
+
+2. **No Harmful Actions**: Security research and vulnerability reporting must not:
+   * Cause damage to running systems or production environments.
+   * Disrupt Node.js development or infrastructure.
+   * Affect other users' applications or systems.
+   * Include actual exploits that could harm users.
+   * Involve social engineering or phishing attempts.
+
+3. **Responsible Testing**: When testing potential vulnerabilities:
+   * Use isolated, controlled environments.
+   * Do not test on production systems.
+   * Do not attempt to access or modify other users' data.
+   * Immediately stop testing if unauthorized access is gained accidentally.
+
+4. **Report Quality**
+   * Provide clear, detailed steps to reproduce the vulnerability.
+   * Include only the minimum proof of concept required to demonstrate the issue.
+   * Remove any malicious payloads or components that could cause harm.
+
+Failure to follow these guidelines may result in:
+
+* Rejection of the vulnerability report.
+* Forfeiture of any potential bug bounty.
+* Temporary or permanent ban from the bug bounty program.
+* Legal action in cases of malicious intent.
+
 ## The Node.js threat model
 
 In the Node.js threat model, there are trusted elements such as the
Repository: electron/electron
Pull request: fix: remove unused id argument from TranslateToStock()

Backport of #44900

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/ui/message_box_gtk.cc
patch: @@ -101,11 +101,10 @@ class GtkMessageBox : private NativeWindowObserver {
     // Add buttons.
     GtkDialog* dialog = GTK_DIALOG(dialog_);
     if (settings.buttons.size() == 0) {
-      gtk_dialog_add_button(dialog, TranslateToStock(0, "OK"), 0);
+      gtk_dialog_add_button(dialog, TranslateToStock("OK"), 0);
     } else {
       for (size_t i = 0; i < settings.buttons.size(); ++i) {
-        gtk_dialog_add_button(dialog, TranslateToStock(i, settings.buttons[i]),
-                              i);
+        gtk_dialog_add_button(dialog, TranslateToStock(settings.buttons[i]), i);
       }
     }
     gtk_dialog_set_default_response(dialog, settings.default_id);
@@ -146,16 +145,20 @@ class GtkMessageBox : private NativeWindowObserver {
     }
   }
 
-  const char* TranslateToStock(int id, const std::string& text) {
+  static const char* TranslateToStock(const std::string& text) {
     const std::string lower = base::ToLowerASCII(text);
-    if (lower == "cancel")
+    if (lower == "cancel") {
       return gtk_util::GetCancelLabel();
-    if (lower == "no")
+    }
+    if (lower == "no") {
       return gtk_util::GetNoLabel();
-    if (lower == "ok")
+    }
+    if (lower == "ok") {
       return gtk_util::GetOkLabel();
-    if (lower == "yes")
+    }
+    if (lower == "yes") {
       return gtk_util::GetYesLabel();
+    }
     return text.c_str();
   }
Repository: huggingface/transformers
Pull request: Modernbert fixes

This PR fixes two thing that led to several test fails in `modernbert`:
- there was a deprecated argument, `pos_idx_in_fp32` , passed to flash_attention `RotaryEmbedding` (class is [here](https://github.com/Dao-AILab/flash-attention/blob/32c491f8c592650c38374545738f589cc3b73c5f/flash_attn/layers/rotary.py#L331)) which caused the error `TypeError: RotaryEmbedding.__init__() got an unexpected keyword argument 'pos_idx_in_fp32'`. This did not happen in A100 because the code path was not used.
- the test `test_sdpa_can_dispatch_on_flash` was not skipped although `modernbert` always sets the attention mask and thus the test fails. It also failed on A100. 

Changed files:
filename: src/transformers/models/modernbert/modeling_modernbert.py
patch: @@ -154,7 +154,7 @@ def __init__(
             up to max_seqlen. If the max_seqlen, device, or dtype during training/inference differ,
             the cos_sin_cache will be recomputed during the forward pass.
         """
-        super().__init__(dim=dim, base=base, pos_idx_in_fp32=True, device=device, interleaved=False)
+        super().__init__(dim=dim, base=base, device=device, interleaved=False)
         self.max_seqlen = max_seqlen
 
         if max_seqlen is not None and device is not None and dtype is not None:

filename: src/transformers/models/modernbert/modular_modernbert.py
patch: @@ -417,7 +417,7 @@ def __init__(
             up to max_seqlen. If the max_seqlen, device, or dtype during training/inference differ,
             the cos_sin_cache will be recomputed during the forward pass.
         """
-        super().__init__(dim=dim, base=base, pos_idx_in_fp32=True, device=device, interleaved=False)
+        super().__init__(dim=dim, base=base, device=device, interleaved=False)
         self.max_seqlen = max_seqlen
 
         if max_seqlen is not None and device is not None and dtype is not None:

filename: tests/test_modeling_common.py
patch: @@ -3795,6 +3795,10 @@ def test_sdpa_can_dispatch_on_flash(self):
                 self.skipTest(
                     "PaliGemma-like models currently (transformers==4.41.0) requires an attention_mask input"
                 )
+            if config.model_type in ["modernbert"]:
+                self.skipTest(
+                    reason="ModernBert currently (transformers==4.52.0) automatically adds an attention_mask input"
+                )
             if config.model_type in ["idefics", "idefics2", "idefics3"]:
                 self.skipTest(reason="Idefics currently (transformers==4.39.1) requires an image_attention_mask input")
             if config.model_type in ["sam"]:
Repository: denoland/deno
Pull request: fix(ext/node): implement `crypto.hash`

Implement [`crypto.hash`](https://nodejs.org/api/crypto.html#cryptohashalgorithm-data-outputencoding) - one-shot version of `createHash`

Fixes #24945 



Changed files:
filename: ext/node/polyfills/crypto.ts
patch: @@ -169,6 +169,16 @@ function getRandomValues(typedArray) {
   return webcrypto.getRandomValues(typedArray);
 }
 
+function hash(
+  algorithm: string,
+  data: BinaryLike,
+  outputEncoding: BinaryToTextEncoding = "hex",
+) {
+  const hash = createHash(algorithm);
+  hash.update(data);
+  return hash.digest(outputEncoding);
+}
+
 function createCipheriv(
   algorithm: CipherCCMTypes,
   key: CipherKey,
@@ -350,6 +360,7 @@ export default {
   getDiffieHellman,
   getFips,
   getHashes,
+  hash,
   Hash,
   hkdf,
   hkdfSync,
@@ -489,6 +500,7 @@ export {
   getHashes,
   getRandomValues,
   Hash,
+  hash,
   hkdf,
   hkdfSync,
   Hmac,

filename: tests/unit_node/crypto/crypto_hash_test.ts
patch: @@ -1,5 +1,5 @@
 // Copyright 2018-2025 the Deno authors. MIT license.
-import { createHash, createHmac, getHashes } from "node:crypto";
+import { createHash, createHmac, getHashes, hash } from "node:crypto";
 import { Buffer } from "node:buffer";
 import { Readable } from "node:stream";
 import { assert, assertEquals } from "@std/assert";
@@ -127,3 +127,8 @@ Deno.test("[node/crypto.hash] does not leak", () => {
   const hasher = createHash("sha1");
   hasher.update("abc");
 });
+
+Deno.test("[node/crypto.hash] oneshot hash API", () => {
+  const d = hash("sha1", "Node.js");
+  assertEquals(d, "10b3493287f831e81a438811a1ffba01f8cec4b7");
+});
Repository: electron/electron
Pull request: fix: remove unused id argument from TranslateToStock()

#### Description of Change

Remove the `id` argument from `TranslateToStock()`. It's been unused since fb537d91fce3f97ac3b902c36fcc4626eef0c959.

Also, fix a small number of warnings in that function: [readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html) and [readability-convert-member-functions-to-static](https://clang.llvm.org/extra/clang-tidy/checks/readability/convert-member-functions-to-static.html)

#### Checklist

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none.

Changed files:
filename: shell/browser/ui/message_box_gtk.cc
patch: @@ -101,11 +101,10 @@ class GtkMessageBox : private NativeWindowObserver {
     // Add buttons.
     GtkDialog* dialog = GTK_DIALOG(dialog_);
     if (settings.buttons.size() == 0) {
-      gtk_dialog_add_button(dialog, TranslateToStock(0, "OK"), 0);
+      gtk_dialog_add_button(dialog, TranslateToStock("OK"), 0);
     } else {
       for (size_t i = 0; i < settings.buttons.size(); ++i) {
-        gtk_dialog_add_button(dialog, TranslateToStock(i, settings.buttons[i]),
-                              i);
+        gtk_dialog_add_button(dialog, TranslateToStock(settings.buttons[i]), i);
       }
     }
     gtk_dialog_set_default_response(dialog, settings.default_id);
@@ -146,16 +145,20 @@ class GtkMessageBox : private NativeWindowObserver {
     }
   }
 
-  const char* TranslateToStock(int id, const std::string& text) {
+  static const char* TranslateToStock(const std::string& text) {
     const std::string lower = base::ToLowerASCII(text);
-    if (lower == "cancel")
+    if (lower == "cancel") {
       return gtk_util::GetCancelLabel();
-    if (lower == "no")
+    }
+    if (lower == "no") {
       return gtk_util::GetNoLabel();
-    if (lower == "ok")
+    }
+    if (lower == "ok") {
       return gtk_util::GetOkLabel();
-    if (lower == "yes")
+    }
+    if (lower == "yes") {
       return gtk_util::GetYesLabel();
+    }
     return text.c_str();
   }