helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: zlib: fix pointer alignment

The function AllocForBrotli prefixes the allocated memory with its size, and returns a pointer to the region after it. This pointer can however no longer be suitably aligned. Correct this by allocating the maximum of the the size of the size_t and the max alignment.

On Arm 32bits the size_t is 4 bytes long, but the alignment is 8 for some NEON instructions. When Brotli is compiled with optimizations enabled newer GCC versions will use the NEON instructions and trigger a bus error killing node.

see https://github.com/google/brotli/issues/1159

I don't think there is any additional test needed, since existing test will crash node already.
Not sure about the notable-change label.



Changed files:
filename: src/node_zlib.cc
patch: @@ -608,7 +608,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
   }
 
   static void* AllocForBrotli(void* data, size_t size) {
-    size += sizeof(size_t);
+    constexpr size_t offset = std::max(sizeof(size_t), alignof(max_align_t));
+    size += offset;
     CompressionStream* ctx = static_cast<CompressionStream*>(data);
     char* memory = UncheckedMalloc(size);
     if (memory == nullptr) [[unlikely]] {
@@ -617,15 +618,16 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
     *reinterpret_cast<size_t*>(memory) = size;
     ctx->unreported_allocations_.fetch_add(size,
                                            std::memory_order_relaxed);
-    return memory + sizeof(size_t);
+    return memory + offset;
   }
 
   static void FreeForZlib(void* data, void* pointer) {
     if (pointer == nullptr) [[unlikely]] {
       return;
     }
     CompressionStream* ctx = static_cast<CompressionStream*>(data);
-    char* real_pointer = static_cast<char*>(pointer) - sizeof(size_t);
+    constexpr size_t offset = std::max(sizeof(size_t), alignof(max_align_t));
+    char* real_pointer = static_cast<char*>(pointer) - offset;
     size_t real_size = *reinterpret_cast<size_t*>(real_pointer);
     ctx->unreported_allocations_.fetch_sub(real_size,
                                            std::memory_order_relaxed);
Repository: ggml-org/llama.cpp
Pull request: vulkan: perf_logger improvements

- Account for batch dimension in flops calculation.
- Fix how "_VEC" is detected for mat_mul_id.
- Fix "n" dimension for mat_mul_id (in case of broadcasting).
- Include a->type in name.


Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -1111,17 +1111,23 @@ class vk_perf_logger {
             return;
         }
         if (node->op == GGML_OP_MUL_MAT || node->op == GGML_OP_MUL_MAT_ID) {
-            const uint64_t m    = node->src[0]->ne[1];
-            const uint64_t n    = node->src[1]->ne[1];
-            const uint64_t k    = node->src[1]->ne[0];
-            std::string    name = ggml_op_name(node->op);
-            if (n == 1) {
-                name += "_VEC m=" + std::to_string(m) + " k=" + std::to_string(k);
-            } else {
-                name += " m=" + std::to_string(m) + " n=" + std::to_string(n) + " k=" + std::to_string(k);
+            const uint64_t m     = node->src[0]->ne[1];
+            const uint64_t n     = node->ne[1];
+            const uint64_t k     = node->src[1]->ne[0];
+            const uint64_t batch = node->src[1]->ne[2] * node->src[1]->ne[3];
+            std::string    name  = ggml_op_name(node->op);
+            if ((node->op == GGML_OP_MUL_MAT && n <= mul_mat_vec_max_cols) ||
+                (node->op == GGML_OP_MUL_MAT_ID && node->src[2]->ne[1] == 1)) {
+                name += "_VEC";
+            }
+            name += " ";
+            name += ggml_type_name(node->src[0]->type);
+            name += " m=" + std::to_string(m) + " n=" + std::to_string(n) + " k=" + std::to_string(k);
+            if (batch > 1) {
+                name += " batch=" + std::to_string(batch);
             }
             timings[name].push_back(time);
-            flops[name].push_back(m * n * (k + (k - 1)));
+            flops[name].push_back(m * n * (k + (k - 1)) * batch);
             return;
         }
         if (node->op == GGML_OP_CONV_2D) {
Repository: huggingface/transformers
Pull request: fix `dots1` tests

# What does this PR do?



Changed files:
filename: tests/models/dots1/test_modeling_dots1.py
patch: @@ -87,6 +87,10 @@ class Dots1ModelTest(CausalLMModelTest, unittest.TestCase):
     test_pruning = False
     model_tester_class = Dots1ModelTester
 
+    @unittest.skip("dots.llm1's moe is not compatible `token_indices, weight_indices = torch.where(mask)`.")
+    def test_generate_with_static_cache(self):
+        pass
+
     @unittest.skip("dots.llm1's moe is not compatible `token_indices, weight_indices = torch.where(mask)`.")
     def test_generate_compilation_all_outputs(self):
         pass
Repository: vercel/next.js
Pull request: [devtools] Allow opting out of environment feature flags

Once you set the environment variable via `export` (e.g. in your bash profile), you'd have to manually unset it to disable the flag since we favored the environment flag over the config flag.

Instead, I'm following the same pattern as for PPR using the environment variable as a default for the config. That way you can globally enable the flag e.g. in your Bash profile, but still opt-out on a per-app basis if needed.

Changed files:
filename: packages/next/src/build/define-env.ts
patch: @@ -107,9 +107,7 @@ export function getDefineEnv({
   const isDynamicIOEnabled = !!config.experimental.dynamicIO
   const isUseCacheEnabled = !!config.experimental.useCache
 
-  const isDevToolPanelUIEnabled =
-    !!process.env.__NEXT_DEVTOOL_NEW_PANEL_UI ||
-    !!config.experimental.devtoolNewPanelUI
+  const isDevToolPanelUIEnabled = Boolean(config.experimental.devtoolNewPanelUI)
 
   const defineEnv: DefineEnv = {
     // internal field to identify the plugin config

filename: packages/next/src/server/config-shared.ts
patch: @@ -1355,6 +1355,7 @@ export const defaultConfig = {
       static: process.env.NEXT_STATIC_CACHE_HANDLER_PATH,
     },
     cssChunking: true,
+    devtoolNewPanelUI: process.env.__NEXT_DEVTOOL_NEW_PANEL_UI === 'true',
     multiZoneDraftMode: false,
     appNavFailHandling: false,
     prerenderEarlyExit: true,
Repository: denoland/deno
Pull request: fix(lsp): limit languages in semantic tokens provider

Fixes https://github.com/denoland/vscode_deno/issues/1228. No meaningful way of testing this.

Changed files:
filename: cli/lsp/capabilities.rs
patch: @@ -127,12 +127,39 @@ pub fn server_capabilities(
     }),
     call_hierarchy_provider: Some(CallHierarchyServerCapability::Simple(true)),
     semantic_tokens_provider: Some(
-      SemanticTokensServerCapabilities::SemanticTokensOptions(
-        SemanticTokensOptions {
-          legend: get_legend(),
-          range: Some(true),
-          full: Some(SemanticTokensFullOptions::Bool(true)),
-          ..Default::default()
+      SemanticTokensServerCapabilities::SemanticTokensRegistrationOptions(
+        SemanticTokensRegistrationOptions {
+          text_document_registration_options: TextDocumentRegistrationOptions {
+            document_selector: Some(vec![
+              DocumentFilter {
+                language: Some("javascript".to_string()),
+                scheme: None,
+                pattern: None,
+              },
+              DocumentFilter {
+                language: Some("javascriptreact".to_string()),
+                scheme: None,
+                pattern: None,
+              },
+              DocumentFilter {
+                language: Some("typescript".to_string()),
+                scheme: None,
+                pattern: None,
+              },
+              DocumentFilter {
+                language: Some("typescriptreact".to_string()),
+                scheme: None,
+                pattern: None,
+              },
+            ]),
+          },
+          semantic_tokens_options: SemanticTokensOptions {
+            legend: get_legend(),
+            range: Some(true),
+            full: Some(SemanticTokensFullOptions::Bool(true)),
+            ..Default::default()
+          },
+          static_registration_options: Default::default(),
         },
       ),
     ),
Repository: facebook/react
Pull request: Flow: upgrade to 0.213.0

Simple upgrade that doesn't require changes.

Changed files:
filename: package.json
patch: @@ -64,8 +64,8 @@
     "eslint-plugin-react-internal": "link:./scripts/eslint-rules",
     "fbjs-scripts": "^3.0.1",
     "filesize": "^6.0.1",
-    "flow-bin": "^0.209.0",
-    "flow-remove-types": "^2.209.0",
+    "flow-bin": "^0.213.0",
+    "flow-remove-types": "^2.213.0",
     "glob": "^7.1.6",
     "glob-stream": "^6.1.0",
     "google-closure-compiler": "^20230206.0.0",

filename: scripts/flow/config/flowconfig
patch: @@ -36,4 +36,4 @@ munge_underscores=false
 %REACT_RENDERER_FLOW_OPTIONS%
 
 [version]
-^0.209.0
+^0.213.0

filename: yarn.lock
patch: @@ -8287,22 +8287,22 @@ flatted@^3.1.0:
   resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
   integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
 
-flow-bin@^0.209.0:
-  version "0.209.0"
-  resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.209.0.tgz#616a002b94ef35e1b083add9a6d27dbe387bf4f0"
-  integrity sha512-HRc6+bKE8AN23SnuKaxdUjcQcjaIp6pksrGJ6pltFO5tIEvZmPrbT99P7Yb3ybqwcKU/Ry8yfJbuW92Ed2V3nw==
-
-flow-parser@^0.209.0:
-  version "0.209.0"
-  resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.209.0.tgz#adf4fa1245b2dd9073bbffbdca5c005e83194430"
-  integrity sha512-uD7Du+9xC/gGnOyk3kANQmtgWWKANWcKGJ84Wu0NSjTaVING3GqUAsywUPAl3fEYKLVVIcDWiaQ8+R6qzghwmA==
-
-flow-remove-types@^2.209.0:
-  version "2.209.0"
-  resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.209.0.tgz#32dbb65515f417067ade9f76260e8badd1baa541"
-  integrity sha512-p8Tvy95IunOvO0PVSb/rqxUqVXRS+G9aLSkDU56eGNTJ4lEdPbnXd+LCUUb3Ntl5t0L0Llndja6cQqjovC1qaQ==
-  dependencies:
-    flow-parser "^0.209.0"
+flow-bin@^0.213.0:
+  version "0.213.0"
+  resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.213.0.tgz#02a85537cce3ea1f61bff77e7995a49a1db2e963"
+  integrity sha512-adGcPA3jiz3l0MM4zHVxVUgatvYsDowjT7cje7AvY38z/M0HO2YKcGLRp2xeqbigCgaqXEV6V3/1TaRDVjR++A==
+
+flow-parser@^0.213.0:
+  version "0.213.0"
+  resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.213.0.tgz#a3a2f9ad3eb56309d6aedd9d45b06f31cf3ebbe8"
+  integrity sha512-jPTKNk0lC/iVbaPzfSReo/I67x+PLYiXkFuxHyFYmlJReP3RAoGbmRSC6g8MCEtzw8Uv3clKFmOlEL/LEcoWlw==
+
+flow-remove-types@^2.213.0:
+  version "2.213.0"
+  resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.213.0.tgz#6c81032a32db98f274420b83b92c6bd1828a4037"
+  integrity sha512-HzEFhp5LI1UVLCwm0jm//ocq51yfsR7YPi3U4vOu0AvZX+cdRVIq9P5YEe4lyY6d8Rx8s+6Q1DUHhpNmlTsqPQ==
+  dependencies:
+    flow-parser "^0.213.0"
     pirates "^3.0.2"
     vlq "^0.2.1"
Repository: vercel/next.js
Pull request: [devtools] memorize tab in session storage

Memorize the opened tab in session storage, this will avoid re-select the desired tab every time after opening it.

https://github.com/user-attachments/assets/86840ee2-7d80-459e-979b-d4fbf929a8f5



Changed files:
filename: packages/next/src/next-devtools/dev-overlay/components/devtools-panel/devtools-panel.tsx
patch: @@ -2,7 +2,7 @@ import type { OverlayDispatch, OverlayState, Corners } from '../../shared'
 import type { ReadyRuntimeError } from '../../utils/get-error-by-type'
 import type { HydrationErrorState } from '../../../shared/hydration-error'
 
-import { useState } from 'react'
+import { useState, useEffect } from 'react'
 
 import { DevToolsPanelFooter } from './devtools-panel-footer'
 import { DevToolsPanelTab } from './devtools-panel-tab/devtools-panel-tab'
@@ -26,6 +26,33 @@ import { MinimizeIcon } from '../../icons/minimize'
 
 export type DevToolsPanelTabType = 'issues' | 'route' | 'settings'
 
+const STORAGE_KEY_ACTIVE_TAB = 'nextjs-devtools-active-tab'
+
+function useSessionState<T extends string>(
+  key: string,
+  initialValue: T
+): [T, (value: T) => void] {
+  const [value, setValue] = useState<T>(() => {
+    if (
+      typeof window !== 'undefined' &&
+      typeof sessionStorage !== 'undefined'
+    ) {
+      const stored = sessionStorage.getItem(key)
+      return (stored as T) ?? initialValue
+    }
+    return initialValue
+  })
+  useEffect(() => {
+    if (
+      typeof window !== 'undefined' &&
+      typeof sessionStorage !== 'undefined'
+    ) {
+      sessionStorage.setItem(key, value)
+    }
+  }, [key, value])
+  return [value, setValue]
+}
+
 export function DevToolsPanel({
   state,
   dispatch,
@@ -39,7 +66,12 @@ export function DevToolsPanel({
   runtimeErrors: ReadyRuntimeError[]
   getSquashedHydrationErrorDetails: (error: Error) => HydrationErrorState | null
 }) {
-  const [activeTab, setActiveTab] = useState<DevToolsPanelTabType>('issues')
+  // Initialize active tab from session storage, fallback to 'issues'
+  const [activeTab, setActiveTab] = useSessionState<DevToolsPanelTabType>(
+    STORAGE_KEY_ACTIVE_TAB,
+    'issues'
+  )
+
   const [isFullscreen, setIsFullscreen] = useState(false)
   const [prevIsErrorOverlayOpen, setPrevIsErrorOverlayOpen] = useState(false)
Repository: nodejs/node
Pull request: crypto: fix output of privateDecrypt with zero-length data

closes #57553
closes #57572
closes #57558
refs #56653

Changed files:
filename: deps/ncrypto/ncrypto.cc
patch: @@ -215,7 +215,7 @@ Buffer<void> DataPointer::release() {
 DataPointer DataPointer::resize(size_t len) {
   size_t actual_len = std::min(len_, len);
   auto buf = release();
-  if (actual_len == len_) return DataPointer(buf);
+  if (actual_len == len_) return DataPointer(buf.data, actual_len);
   buf.data = OPENSSL_realloc(buf.data, actual_len);
   buf.len = actual_len;
   return DataPointer(buf);

filename: test/parallel/test-crypto-oaep-zero-length.js
patch: @@ -0,0 +1,56 @@
+'use strict';
+const common = require('../common');
+
+if (!common.hasCrypto)
+  common.skip('missing crypto');
+
+const fixtures = require('../common/fixtures');
+const assert = require('assert');
+const crypto = require('crypto');
+
+const { subtle } = globalThis.crypto;
+
+// Regression test for https://github.com/nodejs/node/issues/57553.
+{
+  const privateKey = crypto.createPrivateKey(fixtures.readKey('rsa_private.pem', 'ascii'));
+  const publicKey = crypto.createPublicKey(fixtures.readKey('rsa_public.pem', 'ascii'));
+
+  const data = Buffer.alloc(0);
+  {
+
+    const ciphertext = crypto.publicEncrypt({
+      padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
+      key: publicKey,
+    }, data);
+
+    const plaintext = crypto.privateDecrypt({
+      padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
+      key: privateKey
+    }, ciphertext);
+
+    assert.deepStrictEqual(plaintext, data);
+  }
+
+  {
+    const ciphertext = crypto.publicEncrypt(publicKey, data);
+    const plaintext = crypto.privateDecrypt(privateKey, ciphertext);
+
+    assert.deepStrictEqual(plaintext, data);
+  }
+
+  {
+    (async () => {
+      const pkcs8 = privateKey.export({ format: 'der', type: 'pkcs8' });
+      const spki = publicKey.export({ format: 'der', type: 'spki' });
+
+      const kp = {
+        privateKey: await subtle.importKey('pkcs8', pkcs8, { name: 'RSA-OAEP', hash: 'SHA-1' }, false, ['decrypt']),
+        publicKey: await subtle.importKey('spki', spki, { name: 'RSA-OAEP', hash: 'SHA-1' }, false, ['encrypt']),
+      };
+
+      const ciphertext = await subtle.encrypt('RSA-OAEP', kp.publicKey, data);
+      const plaintext = await subtle.decrypt('RSA-OAEP', kp.privateKey, ciphertext);
+      assert.deepStrictEqual(plaintext, data.buffer);
+    })().then(common.mustCall());
+  }
+}
Repository: vercel/next.js
Pull request: [devtools] increase max-width/height limit

Increase the **default** (not only fullscreen mode) max-width/height of the DevTools panel to provide more information to the user.

The height will remain pretty much the same unless the user opens the ignored list.

Closes NEXT-4566

Changed files:
filename: packages/next/src/next-devtools/dev-overlay/components/devtools-panel/devtools-panel.tsx
patch: @@ -243,6 +243,10 @@ export const DEVTOOLS_PANEL_STYLES = css`
     @media (min-width: 992px) {
       max-width: 960px;
     }
+
+    @media (min-width: 1200px) {
+      max-width: 1140px;
+    }
   }
 
   [data-nextjs-devtools-panel-overlay-backdrop] {
@@ -271,7 +275,7 @@ export const DEVTOOLS_PANEL_STYLES = css`
     box-shadow: var(--shadow-lg);
     position: relative;
     width: 100%;
-    max-height: 50vh;
+    max-height: 75vh;
     min-height: 450px;
   }
Repository: ggml-org/llama.cpp
Pull request: perplexity: Provide a helpful hint for has_cpl case in split_equal error.

When attempting to do llama-perplexity on certain tasks which have coupled sequences there is a cryptic error that does not tell you what to do, which is to set the `-kvu` flag. This adds a hint about that fact.

Changed files:
filename: src/llama-batch.cpp
patch: @@ -477,7 +477,7 @@ llama_ubatch llama_batch_allocr::split_simple(uint32_t n_ubatch) {
 
 llama_ubatch llama_batch_allocr::split_equal(uint32_t n_ubatch, bool sequential) {
     if (sequential && has_cpl) {
-        LLAMA_LOG_ERROR("%s: sequential split is not supported when there are coupled sequences in the input batch\n", __func__);
+        LLAMA_LOG_ERROR("%s: sequential split is not supported when there are coupled sequences in the input batch (you may need to use the -kvu flag)\n", __func__);
 
         return {};
     }
Repository: huggingface/transformers
Pull request: guard torch distributed check

This PR fixes issue where transformer pipelines invoke `torch.distributed.is_initialized()` in `src/transformers/pipelines/base.py`.

We need to check if `torch.distributed.is_available()` before checking if `torch.distributed.is_initialized()` otherwise we will face 
```
File "C:\develop\v\Lib\site-packages\transformers\pipelines\base.py", line 1036, in __init__
    if is_torch_available() and torch.distributed.is_initialized():
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'torch.distributed' has no attribute 'is_initialized'
```
Similar issue but in different file is mentioned on [Regression: Need to guard torch.distributed.is_initialized with torch.distributed.is_available #26039](https://github.com/huggingface/transformers/issues/26039) and solved with [safeguard torch distributed check #26056](https://github.com/huggingface/transformers/pull/26056).

Changed files:
filename: src/transformers/pipelines/base.py
patch: @@ -1033,7 +1033,7 @@ def __init__(
         else:
             self.device = device if device is not None else -1
 
-        if is_torch_available() and torch.distributed.is_initialized():
+        if is_torch_available() and torch.distributed.is_available() and torch.distributed.is_initialized():
             self.device = self.model.device
         logger.warning(f"Device set to use {self.device}")
Repository: denoland/deno
Pull request: fix: respect lockfile for multiple available jsr versions

Fixes https://github.com/denoland/vscode_deno/issues/1265. Ref https://github.com/denoland/deno_graph/pull/572.

Changed files:
filename: Cargo.lock
patch: @@ -2013,9 +2013,9 @@ dependencies = [
 
 [[package]]
 name = "deno_graph"
-version = "0.89.0"
+version = "0.89.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ca8039ee1325d0d5dd60765c55177dc16b904f2457185ca815829d1e83eb588"
+checksum = "0c38c64a94e1e7792aa6eab7b013a075d88b3e04387d2c1291ecc2934c930095"
 dependencies = [
  "async-trait",
  "capacity_builder 0.5.0",

filename: Cargo.toml
patch: @@ -56,7 +56,7 @@ deno_core = { version = "0.340.0" }
 deno_bench_util = { version = "0.187.0", path = "./bench_util" }
 deno_config = { version = "=0.50.0", features = ["workspace"] }
 deno_doc = "=0.169.0"
-deno_graph = "=0.89.0"
+deno_graph = "=0.89.1"
 deno_lint = "=0.74.0"
 deno_lockfile = "=0.24.0"
 deno_media_type = { version = "=0.2.6", features = ["module_specifier"] }
Repository: denoland/deno
Pull request: fix(unstable): lint plugin swapped exported and source for ExportAllDeclaration

The `source` and `exported` property were swapped for the `ExportAllDeclaration` node.

Fixes one issue reported at https://github.com/denoland/deno/issues/28355

Changed files:
filename: cli/tools/lint/ast_buffer/swc.rs
patch: @@ -213,8 +213,12 @@ fn serialize_module_decl(
         ctx.write_export_all_decl(
           &node.span,
           node.type_only,
-          exported,
-          source,
+          // Namespaced export must always have a source, so this
+          // scenario where it's optional can't happen. I think
+          // it's just the way SWC stores things internally, since they
+          // don't have a dedicated node for namespace exports.
+          source.unwrap_or(NodeRef(0)),
+          Some(exported),
           attrs,
         )
       } else {

filename: tests/unit/__snapshots__/lint_plugin_test.ts.snap
patch: @@ -1231,27 +1231,27 @@ snapshot[`Plugin - ExportAllDeclaration 2`] = `
   attributes: [],
   exportKind: "value",
   exported: {
+    name: "foo",
+    optional: false,
     range: [
-      21,
-      26,
+      12,
+      15,
     ],
-    raw: '"foo"',
-    type: "Literal",
-    value: "foo",
+    type: "Identifier",
+    typeAnnotation: undefined,
   },
   range: [
     0,
     27,
   ],
   source: {
-    name: "foo",
-    optional: false,
     range: [
-      12,
-      15,
+      21,
+      26,
     ],
-    type: "Identifier",
-    typeAnnotation: undefined,
+    raw: '"foo"',
+    type: "Literal",
+    value: "foo",
   },
   type: "ExportAllDeclaration",
 }