helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Turbopack Build: Add comment explaining reason for skipped test

## What?

Follow-up for comment on #79376

Closes PACK-4643

Changed files:
filename: test/integration/invalid-document-image-import/test/index.test.js
patch: @@ -7,6 +7,7 @@ jest.setTimeout(1000 * 60 * 2)
 const appDir = join(__dirname, '../')
 const nextConfig = new File(join(appDir, 'next.config.js'))
 
+// Skipped in Turbopack as Turbopack doesn't have this error as it can process these imports.
 ;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)(
   'Invalid static image import in _document',
   () => {
Repository: electron/electron
Pull request: fix: -Wunsafe-buffer-usage warning in WriteAsciiChunk()

#### Description of Change

Part 16 in a [series](https://github.com/electron/electron/pull/43477) to fix `-Wunsafe-buffer-usage` warnings in Electron `shell/`. This PR fixes a minor API mismatch between Chromium's [spanification](https://groups.google.com/a/chromium.org/g/chromium-dev/c/iEy69ygz-rs) and `v8::OutputStream::WriteAsciiChunk(char* data, int size)`. 

Fixed by this PR:

```
2024-10-04T05:37:05.4109190Z ../../electron/shell/common/heap_snapshot.cc:27:26: error: function introduces unsafe buffer manipulation [-Werror,-Wunsafe-buffer-usage]
2024-10-04T05:37:05.4110250Z    27 |     auto bytes_written = file_->WriteAtCurrentPos(data, size);
2024-10-04T05:37:05.4110860Z       |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-10-04T05:37:05.4111530Z ../../electron/shell/common/heap_snapshot.cc:27:26: note: See //docs/unsafe_buffers.md for help.
2024-10-04T05:37:05.4112120Z 1 error generated.
```

This workaround can be removed if/when v8 changes `v8::OutputStreamWriteAsciiChunk()` to have a [`v8::MemorySpan`](https://chromium.googlesource.com/v8/v8.git/+/main/include/v8-memory-span.h#52) arg.

#### 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/common/heap_snapshot.cc
patch: @@ -4,6 +4,7 @@
 
 #include "shell/common/heap_snapshot.h"
 
+#include "base/containers/span.h"
 #include "base/files/file.h"
 #include "base/memory/raw_ptr.h"
 #include "v8/include/v8-profiler.h"
@@ -24,8 +25,13 @@ class HeapSnapshotOutputStream : public v8::OutputStream {
   void EndOfStream() override { is_complete_ = true; }
 
   v8::OutputStream::WriteResult WriteAsciiChunk(char* data, int size) override {
-    auto bytes_written = file_->WriteAtCurrentPos(data, size);
-    return bytes_written == size ? kContinue : kAbort;
+    const uint8_t* udata = reinterpret_cast<const uint8_t*>(data);
+    const size_t usize = static_cast<size_t>(std::max(0, size));
+    // SAFETY: since WriteAsciiChunk() only gives us data + size, our
+    // UNSAFE_BUFFERS macro call is unavoidable here. It can be removed
+    // if/when v8 changes WriteAsciiChunk() to pass a v8::MemorySpan.
+    const auto data_span = UNSAFE_BUFFERS(base::span(udata, usize));
+    return file_->WriteAtCurrentPosAndCheck(data_span) ? kContinue : kAbort;
   }
 
  private:
Repository: denoland/deno
Pull request: fix(ext/node): internal buffer length in readSync

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

Changed files:
filename: ext/node/polyfills/_fs/_fs_read.ts
patch: @@ -173,7 +173,7 @@ export function readSync(
   validateBuffer(buffer);
 
   if (length == null) {
-    length = 0;
+    length = buffer.byteLength;
   }
 
   if (typeof offsetOrOpt === "number") {

filename: tests/unit_node/fs_test.ts
patch: @@ -4,13 +4,16 @@ import { assert, assertEquals, assertThrows } from "@std/assert";
 import { join } from "node:path";
 import { tmpdir } from "node:os";
 import {
+  closeSync,
   constants,
   createWriteStream,
   existsSync,
   lstatSync,
   mkdtempSync,
+  openSync,
   promises,
   readFileSync,
+  readSync,
   Stats,
   statSync,
   writeFileSync,
@@ -201,3 +204,11 @@ Deno.test(
     assertEquals(res, [0, 1, 2, 3, 4, 5]);
   },
 );
+
+Deno.test("[node/fs] readSync works", () => {
+  const fd = openSync("tests/testdata/assets/hello.txt", "r");
+  const buf = new Uint8Array(256);
+  const bytesRead = readSync(fd!, buf);
+  assertEquals(bytesRead, 12);
+  closeSync(fd!);
+});
Repository: ggml-org/llama.cpp
Pull request: llama-chat : Do not throw when tool parsing fails

Currently when a model generates output which looks like a tool call, but is invalid an exception is thrown and not handled, causing the cli or llama-server to bail. Instead, handle the chat parser exception and simply return the generated text in such cases.

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*


Changed files:
filename: common/chat-parser.cpp
patch: @@ -49,6 +49,7 @@ bool common_chat_msg_parser::add_tool_call(const std::string & name, const std::
 
     // LOG_DBG("Tool call arguments:\n\traw: %s\n\tresult: %s\n", arguments.c_str(), tool_call.arguments.c_str());
     result_.tool_calls.emplace_back(tool_call);
+
     return true;
 }
 bool common_chat_msg_parser::add_tool_call(const json & tool_call) {
@@ -378,3 +379,7 @@ std::optional<common_chat_msg_parser::consume_json_result> common_chat_msg_parse
         /* .is_partial = */ found_healing_marker,
     };
 }
+
+void common_chat_msg_parser::clear_tools() {
+    result_.tool_calls.clear();
+}

filename: common/chat-parser.h
patch: @@ -115,4 +115,6 @@ class common_chat_msg_parser {
         const std::vector<std::vector<std::string>> & args_paths = {},
         const std::vector<std::vector<std::string>> & content_paths = {}
     );
+
+    void clear_tools();
 };

filename: common/chat.cpp
patch: @@ -1921,7 +1921,9 @@ common_chat_msg common_chat_parse(const std::string & input, bool is_partial, co
     } catch (const common_chat_msg_partial_exception & ex) {
         LOG_DBG("Partial parse: %s\n", ex.what());
         if (!is_partial) {
-            throw std::runtime_error(ex.what());
+            builder.clear_tools();
+            builder.move_to(0);
+            common_chat_parse_content_only(builder);
         }
     }
     auto msg = builder.result();
Repository: facebook/react
Pull request: CI: delete AppVeyor config

I noticed this file as #24892 is updating the NodeJS version in it.

I don't think this is used for anything as the config just runs a handful of yarn commands and I assume that's all covered by CircleCI.

Changed files:
filename: appveyor.yml
patch: @@ -1,41 +0,0 @@
-image: Visual Studio 2017
-
-# Fix line endings in Windows. (runs before repo cloning)
-init:
-  - git config --global core.autocrlf input
-
-environment:
-  JAVA_HOME: C:\Program Files\Java\jdk1.8.0
-  matrix:
-    - nodejs_version: 10
-
-# Finish on first failed build
-matrix:
-  fast_finish: true
-
-platform:
-  - x64
-
-branches:
-  only:
-    - main
-
-# Disable Visual Studio build and deploy
-build: off
-deploy: off
-
-install:
-  - ps: Install-Product node $env:nodejs_version $env:platform
-  - yarn install --frozen-lockfile
-
-test_script:
-  - node --version
-  - yarn lint
-#  - yarn flow-ci
-  - yarn build
-  - yarn test
-  - yarn prettier
-
-cache:
- - node_modules
- - "%LOCALAPPDATA%/Yarn"
Repository: vercel/next.js
Pull request: Update Turbopack development test manifest

This auto-generated PR updates the development integration test manifest used when testing Turbopack.

Changed files:
filename: test/turbopack-dev-tests-manifest.json
patch: @@ -6119,7 +6119,13 @@
   },
   "test/e2e/app-dir/empty-fallback-shells/empty-fallback-shells.test.ts": {
     "passed": [
-      "empty-fallback-shells should start and not postpone the response"
+      "empty-fallback-shells with cached IO and the page not wrapped in Suspense and params.then/catch/finally passed to a cached function does not resume a postponed fallback shell",
+      "empty-fallback-shells with cached IO and the page not wrapped in Suspense and the params accessed in a cached non-page function does not resume a postponed fallback shell",
+      "empty-fallback-shells with cached IO and the page not wrapped in Suspense and the params accessed in the cached page does not resume a postponed fallback shell",
+      "empty-fallback-shells with cached IO and the page wrapped in Suspense and params.then/catch/finally passed to a cached function resumes a postponed fallback shell",
+      "empty-fallback-shells with cached IO and the page wrapped in Suspense and the params accessed in cached non-page function resumes a postponed fallback shell",
+      "empty-fallback-shells with cached IO and the page wrapped in Suspense and the params accessed in the cached page resumes a postponed fallback shell",
+      "empty-fallback-shells without IO should start and not postpone the response"
     ],
     "failed": [],
     "pending": [],
Repository: vercel/next.js
Pull request: Turbopack Build: Fix next/dynamic test

Alternative solution for #79406, see the extensive description over there

Fixes PACK-4514

Changed files:
filename: crates/next-api/src/loadable_manifest.rs
patch: @@ -1,8 +1,7 @@
 use anyhow::Result;
 use next_core::{next_manifests::LoadableManifest, util::NextRuntime};
 use rustc_hash::FxHashMap;
-use turbo_rcstr::RcStr;
-use turbo_tasks::{ResolvedVc, TryFlatJoinIterExt, ValueToString, Vc};
+use turbo_tasks::{ResolvedVc, TryFlatJoinIterExt, Vc};
 use turbo_tasks_fs::{File, FileContent, FileSystemPath};
 use turbopack_core::{
     asset::AssetContent,
@@ -22,12 +21,12 @@ pub async fn create_react_loadable_manifest(
 ) -> Result<Vc<OutputAssets>> {
     let dynamic_import_entries = &*dynamic_import_entries.await?;
 
-    let mut loadable_manifest: FxHashMap<RcStr, LoadableManifest> = FxHashMap::default();
+    let mut loadable_manifest: FxHashMap<String, LoadableManifest> = FxHashMap::default();
 
     for (_, (module_id, chunk_output)) in dynamic_import_entries.into_iter() {
         let chunk_output = chunk_output.await?;
 
-        let id = module_id.to_string().owned().await?;
+        let id = &*module_id.await?;
 
         let client_relative_path_value = client_relative_path.await?;
         let files = chunk_output
@@ -44,11 +43,11 @@ pub async fn create_react_loadable_manifest(
             .await?;
 
         let manifest_item = LoadableManifest {
-            id: id.clone(),
+            id: id.into(),
             files,
         };
 
-        loadable_manifest.insert(id, manifest_item);
+        loadable_manifest.insert(id.to_string(), manifest_item);
     }
 
     let manifest_json = serde_json::to_string_pretty(&loadable_manifest)?;

filename: crates/next-core/src/next_manifests/mod.rs
patch: @@ -269,10 +269,10 @@ pub struct AppPathsManifest {
 // The manifest is in a format of:
 // { [`${origin} -> ${imported}`]: { id: `${origin} -> ${imported}`, files:
 // string[] } }
-#[derive(Serialize, Default, Debug)]
+#[derive(Serialize, Debug)]
 #[serde(rename_all = "camelCase")]
 pub struct LoadableManifest {
-    pub id: RcStr,
+    pub id: ModuleId,
     pub files: Vec<RcStr>,
 }
 

filename: test/turbopack-build-tests-manifest.json
patch: @@ -15648,10 +15648,11 @@
     "runtimeError": false
   },
   "test/integration/next-dynamic/test/index.test.js": {
-    "passed": ["next/dynamic production mode should render server value"],
-    "failed": [
+    "passed": [
+      "next/dynamic production mode should render server value",
       "next/dynamic production mode should render dynamic server rendered values on client mount"
     ],
+    "failed": [],
     "pending": [
       "next/dynamic development mode should render dynamic server rendered values on client mount",
       "next/dynamic development mode should render server value"
Repository: nodejs/node
Pull request: build: do not put commands in sources variables

The `_sources` variables are also read by GN and putting anything other than filenames in them would end up with GN errors.

Changed files:
filename: configure.py
patch: @@ -1394,6 +1394,11 @@ def gcc_version_ge(version_checked):
 def configure_node_lib_files(o):
   o['variables']['node_library_files'] = SearchFiles('lib', 'js')
 
+def configure_node_cctest_sources(o):
+  o['variables']['node_cctest_sources'] = [ 'src/node_snapshot_stub.cc' ] + \
+    SearchFiles('test/cctest', 'cc') + \
+    SearchFiles('test/cctest', 'h')
+
 def configure_node(o):
   if options.dest_os == 'android':
     o['variables']['OS'] = 'android'
@@ -2207,6 +2212,7 @@ def make_bin_override():
 
 configure_node(output)
 configure_node_lib_files(output)
+configure_node_cctest_sources(output)
 configure_napi(output)
 configure_library('zlib', output)
 configure_library('http_parser', output)

filename: node.gyp
patch: @@ -402,11 +402,6 @@
       'src/quic/transportparams.h',
       'src/quic/quic.cc',
     ],
-    'node_cctest_sources': [
-      'src/node_snapshot_stub.cc',
-      '<!@("<(python)" tools/search_files.py . test/cctest cc)',
-      '<!@("<(python)" tools/search_files.py . test/cctest h)',
-    ],
     'node_cctest_openssl_sources': [
       'test/cctest/test_crypto_clienthello.cc',
       'test/cctest/test_node_crypto.cc',

filename: unofficial.gni
patch: @@ -362,13 +362,26 @@ template("node_gn_build") {
       "$node_simdutf_path",
     ]
 
-    sources = gypi_values.node_cctest_sources
+    sources = [ "src/node_snapshot_stub.cc" ]
+    sources += exec_script("./tools/search_files.py",
+                           [ rebase_path(".", root_build_dir),
+                             rebase_path("test/cctest", root_build_dir),
+                             "cc" ],
+                           "list lines")
+
     if (node_use_openssl) {
       deps += [ "deps/ncrypto" ]
-      sources += gypi_values.node_cctest_openssl_sources
+    } else {
+      sources -= gypi_values.node_cctest_openssl_sources
     }
     if (node_enable_inspector) {
-      sources += gypi_values.node_cctest_inspector_sources
+      deps += [ "src/inspector:crdtp" ]
+      include_dirs = [
+        "$target_gen_dir/src",
+        "$target_gen_dir/src/inspector",
+      ]
+    } else {
+      sources -= gypi_values.node_cctest_inspector_sources
     }
   }
Repository: denoland/deno
Pull request: fix(console): missing cause property on non-error objects

Fixes https://github.com/denoland/deno/issues/26047

Changed files:
filename: ext/console/01_console.js
patch: @@ -1301,7 +1301,9 @@ function getKeys(value, showHidden) {
       ArrayPrototypePushApply(keys, ArrayPrototypeFilter(symbols, filter));
     }
   }
-  keys = ArrayPrototypeFilter(keys, (key) => key !== "cause");
+  if (ObjectPrototypeIsPrototypeOf(ErrorPrototype, value)) {
+    keys = ArrayPrototypeFilter(keys, (key) => key !== "cause");
+  }
   return keys;
 }
 

filename: tests/unit/console_test.ts
patch: @@ -1913,6 +1913,21 @@ Deno.test(function consoleLogWhenCauseIsAssignedShouldNotPrintCauseTwice() {
   });
 });
 
+Deno.test(function consoleLogCauseNotFilteredOnNonError() {
+  mockConsole((console, out) => {
+    const foo = {
+      a: 1,
+      b: 2,
+      cause: 3,
+    };
+    console.log(foo);
+
+    const result = stripAnsiCode(out.toString());
+    const expected = "{ a: 1, b: 2, cause: 3 }\n";
+    assertEquals(result.trim(), expected.trim());
+  });
+});
+
 // console.log(new Proxy(new RegExp(), {}))
 Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedRegExp() {
   mockConsole((console, out) => {
Repository: vercel/next.js
Pull request: Only share incremental cache for edge in next start

This backports https://github.com/vercel/next.js/pull/79386 to 14 release channel

Changed files:
filename: packages/next/src/server/base-server.ts
patch: @@ -1245,6 +1245,8 @@ export default abstract class Server<ServerOptions extends Options = Options> {
         })
         incrementalCache.resetRequestCache()
         addRequestMeta(req, 'incrementalCache', incrementalCache)
+        // This is needed for pages router to leverage unstable_cache
+        // TODO: re-work this handling to not use global and use a AsyncStore
         ;(globalThis as any).__incrementalCache = incrementalCache
       }
 
@@ -2106,13 +2108,15 @@ export default abstract class Server<ServerOptions extends Options = Options> {
 
     // use existing incrementalCache instance if available
     const incrementalCache =
-      (globalThis as any).__incrementalCache ||
-      (await this.getIncrementalCache({
-        requestHeaders: Object.assign({}, req.headers),
-        requestProtocol: protocol.substring(0, protocol.length - 1) as
-          | 'http'
-          | 'https',
-      }))
+      process.env.NEXT_RUNTIME === 'edge' &&
+      (globalThis as any).__incrementalCache
+        ? (globalThis as any).__incrementalCache
+        : await this.getIncrementalCache({
+            requestHeaders: Object.assign({}, req.headers),
+            requestProtocol: protocol.substring(0, protocol.length - 1) as
+              | 'http'
+              | 'https',
+          })
 
     incrementalCache?.resetRequestCache()
 

filename: packages/next/src/server/web/adapter.ts
patch: @@ -169,7 +169,10 @@ export async function adapter(
   }
 
   if (
-    !(globalThis as any).__incrementalCache &&
+    // If we are inside of the next start sandbox
+    // leverage the shared instance if not we need
+    // to create a fresh cache instance each time
+    !(globalThis as any).__incrementalCacheShared &&
     (params as any).IncrementalCache
   ) {
     ;(globalThis as any).__incrementalCache = new (

filename: packages/next/src/server/web/sandbox/sandbox.ts
patch: @@ -72,6 +72,7 @@ export async function getRuntimeContext(params: {
   })
 
   if (params.incrementalCache) {
+    runtime.context.globalThis.__incrementalCacheShared = true
     runtime.context.globalThis.__incrementalCache = params.incrementalCache
   }
Repository: huggingface/transformers
Pull request: Pass `eps` to `Mistral3RMSNorm`

# What does this PR do?

Fixes #38025

This solution is part of the investigation detailed [here](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Instruct-2503/discussions/74)

@qubvel


Changed files:
filename: src/transformers/models/mistral3/modeling_mistral3.py
patch: @@ -104,7 +104,7 @@ def forward(self, image_features: torch.Tensor, image_sizes: torch.Tensor) -> to
 class Mistral3MultiModalProjector(nn.Module):
     def __init__(self, config: Mistral3Config):
         super().__init__()
-        self.norm = Mistral3RMSNorm(config.vision_config.hidden_size)
+        self.norm = Mistral3RMSNorm(config.vision_config.hidden_size, eps=config.text_config.rms_norm_eps)
         self.patch_merger = Mistral3PatchMerger(config)
         # We have hidden_size * the number of vision feature layers
         num_feature_layers = 1 if isinstance(config.vision_feature_layer, int) else len(config.vision_feature_layer)

filename: src/transformers/models/mistral3/modular_mistral3.py
patch: @@ -82,7 +82,7 @@ def forward(self, image_features: torch.Tensor, image_sizes: torch.Tensor) -> to
 class Mistral3MultiModalProjector(nn.Module):
     def __init__(self, config: Mistral3Config):
         super().__init__()
-        self.norm = Mistral3RMSNorm(config.vision_config.hidden_size)
+        self.norm = Mistral3RMSNorm(config.vision_config.hidden_size, eps=config.text_config.rms_norm_eps)
         self.patch_merger = Mistral3PatchMerger(config)
         # We have hidden_size * the number of vision feature layers
         num_feature_layers = 1 if isinstance(config.vision_feature_layer, int) else len(config.vision_feature_layer)
Repository: facebook/react
Pull request: ReactHooks.js - delete emptyObject

It's not mentioned in docs and never used by projects.. should be removed..

## Summary

It's not mentioned in docs and never used by projects.. should be removed..

## How did you test this change?

PR CI

Changed files:
filename: packages/react/src/ReactHooks.js
patch: @@ -158,8 +158,6 @@ export function useDebugValue<T>(
   }
 }
 
-export const emptyObject = {};
-
 export function useTransition(): [
   boolean,
   (callback: () => void, options?: StartTransitionOptions) => void,
Repository: ggml-org/llama.cpp
Pull request: Add geglu activation function

Add [GeGLU](https://github.com/huggingface/diffusers/blob/375ec930863ee74d0a0d5209f5627a5c89c752c2/src/diffusers/models/activations.py#L93)

Update: this was added to support models like ModernBert (#14014)


Changed files:
filename: src/llama-graph.cpp
patch: @@ -659,6 +659,28 @@ ggml_tensor * llm_graph_context::build_ffn(
                 cur = ggml_mul(ctx0, x0, x1);
                 cb(cur, "ffn_mul", il);
             } break;
+        case LLM_FFN_GEGLU:
+            {
+                // Split into two equal parts
+                int64_t split_point = cur->ne[0] / 2;
+                ggml_tensor * output_ffn_up = ggml_cont(ctx0, ggml_view_2d(
+                                                ctx0, cur, split_point,
+                                                cur->ne[1], cur->nb[1], 0
+                                            ));
+                ggml_tensor * output_ffn_gate = ggml_cont(ctx0, ggml_view_2d(
+                                                ctx0, cur, split_point,
+                                                cur->ne[1], cur->nb[1],
+                                                split_point * ggml_element_size(cur)
+                                            ));
+
+                // Apply GELU activation function to the first part
+                output_ffn_up = ggml_gelu(ctx0, output_ffn_up);
+                cb(output_ffn_up, "ffn_gelu", il);
+
+                // Element-wise multiplication between the activated part and the gate part
+                cur = ggml_mul(ctx0, output_ffn_up, output_ffn_gate);
+                cb(cur, "ffn_geglu", il);
+            } break;
     }
 
     if (gate && type_gate == LLM_FFN_PAR) {

filename: src/llama-graph.h
patch: @@ -36,6 +36,7 @@ enum llm_ffn_op_type {
     LLM_FFN_RELU,
     LLM_FFN_RELU_SQR,
     LLM_FFN_SWIGLU,
+    LLM_FFN_GEGLU,
 };
 
 enum llm_ffn_gate_type {
Repository: ggml-org/llama.cpp
Pull request: vocab : fix build


Changed files:
filename: src/llama-vocab.cpp
patch: @@ -9,17 +9,16 @@
 
 #include <algorithm>
 #include <cassert>
+#include <cctype>
 #include <cfloat>
-#include <climits>
 #include <cstdarg>
 #include <cstring>
 #include <forward_list>
+#include <limits>
 #include <map>
 #include <queue>
 #include <set>
 #include <unordered_map>
-#include <cctype>
-#include <cinttypes>
 
 //
 // helpers