helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: [DevTools][Bug] Fix Race Condition When Unmounting Fibers

Addresses [this comment](https://github.com/facebook/react/issues/23202#issuecomment-1101180251).

---

When we delete fibers, we will call `onCommitFiberUnmount` on every deleted fiber to also remove them from the element tree. However, there are some cases where fibers aren't deleted but we still want to remove them from the element tree (ex. offscreen). In the second case, we recursively remove these children during `handleCommitFiberRoot`. 

When we remove an element, we will untrack its corresponding fiber ID. However, because of fast refresh, we don't do this immediately, opting to instead add the value to a set to process later. However, before the set has been processed, we unmount that fiber again, we will get duplicate unmounts.

To fix this, `handleCommitFiberRoot` explicitly flushes all the fibers in the set before starting the deletion process. We also need to do this in `handleCommitFiberUnmount` in case `handleCommitFiberRoot` gets called first.

Changed files:
filename: packages/react-devtools-shared/src/backend/renderer.js
patch: @@ -2630,6 +2630,10 @@ export function attach(
   }
 
   function handleCommitFiberUnmount(fiber) {
+    // Flush any pending Fibers that we are untracking before processing the new commit.
+    // If we don't do this, we might end up double-deleting Fibers in some cases (like Legacy Suspense).
+    untrackFibers();
+
     // This is not recursive.
     // We can't traverse fibers after unmounting so instead
     // we rely on React telling us about each unmount.
Repository: vercel/next.js
Pull request: fix(CI): Avoid rebuilding native code in jobs that don't depend on native code

The following jobs do not depend on `build-native`, but don't specify `skipNativeBuild`:

- `lint`
- `test-devlow`
- `test-next-swc-wasm`
- `test-next-swc-napi-wasi` *(currently disabled)*
- `test-unit` *(does actually appear to depend on native binaries)*

That means that they still build the native binary, but they don't wait for `build-native` to finish first, so they don't use the cached version (they run before the cache is populated), and instead each spend 5 minutes of CPU time rebuilding the native binary.

Closes PACK-4549

Changed files:
filename: .github/workflows/build_and_test.yml
patch: @@ -86,6 +86,8 @@ jobs:
     needs: ['build-next']
     uses: ./.github/workflows/build_reusable.yml
     with:
+      skipNativeBuild: 'yes'
+      skipNativeInstall: 'yes'
       afterBuild: |
         pnpm lint-no-typescript
         pnpm check-examples
@@ -213,6 +215,7 @@ jobs:
     if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }}
     uses: ./.github/workflows/build_reusable.yml
     with:
+      skipNativeBuild: 'yes'
       stepName: 'test-devlow'
       afterBuild: |
         pnpm run --filter=devlow-bench test
@@ -342,6 +345,8 @@ jobs:
 
     uses: ./.github/workflows/build_reusable.yml
     with:
+      skipNativeBuild: 'yes'
+      skipNativeInstall: 'yes'
       afterBuild: |
         rustup target add wasm32-unknown-unknown
         curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
@@ -371,6 +376,8 @@ jobs:
 
     uses: ./.github/workflows/build_reusable.yml
     with:
+      skipNativeBuild: 'yes'
+      skipNativeInstall: 'yes'
       afterBuild: |
         rustup target add wasm32-wasip1-threads
         pnpm dlx turbo@${TURBO_VERSION} run build-native-wasi
@@ -379,7 +386,7 @@ jobs:
 
   test-unit:
     name: test unit
-    needs: ['changes']
+    needs: ['changes', 'build-next', 'build-native']
     if: ${{ needs.changes.outputs.docs-only == 'false' }}
 
     strategy:
Repository: ggml-org/llama.cpp
Pull request: ci : enable winget package updates

Test run looks ok: https://github.com/ggml-org/llama.cpp/actions/runs/15218367647/job/42808990098

Changed files:
filename: .github/workflows/winget.yml
patch: @@ -38,5 +38,5 @@ jobs:
           komac update --version ${{ env.VERSION }} \
             --urls "https://github.com/ggml-org/llama.cpp/releases/download/${{ env.VERSION }}/llama-${{ env.VERSION }}-bin-win-vulkan-x64.zip" \
             --token ${{ secrets.WINGET_GITHUB_TOKEN }} \
-            --dry-run \
+            --submit \
             ggml.llamacpp
Repository: facebook/react
Pull request: Fixed possible undefined error in TreeContext reducer

Resolves #24441

I don't have a repro for this bug. It's just something that was found in Sentry logs.

Tracing through the `Store` code, I didn't spot how this case would occur– since it seems like it should only be possible if the cached errors/warnings didn't align with the most recent errors/warnings:
https://github.com/facebook/react/blob/024a7274fb07f154676ec6443b83a4e31f259c22/packages/react-devtools-shared/src/devtools/store.js#L109-L112

But I'm not sure how that would happen, since we clear the cache whenever the tree is mutated (which is the only time when the error/warning counts could change):
https://github.com/facebook/react/blob/024a7274fb07f154676ec6443b83a4e31f259c22/packages/react-devtools-shared/src/devtools/store.js#L1265-L1279

That being said, I think it still seems worth tightening up the logic in `TreeContext` so that it's not possible for this code to try to reference an item in an empty `elementIndicesWithErrorsOrWarnings` array.
https://github.com/facebook/react/blob/024a7274fb07f154676ec6443b83a4e31f259c22/packages/react-devtools-shared/src/devtools/views/Components/TreeContext.js#L405-L416

I don't feel strongly about this. Just wanted to share it for your consideration.

Changed files:
filename: packages/react-devtools-shared/src/devtools/views/Components/TreeContext.js
patch: @@ -377,12 +377,11 @@ function reduceTreeState(store: Store, state: State, action: Action): State {
         }
         break;
       case 'SELECT_PREVIOUS_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE': {
-        if (store.errorCount === 0 && store.warningCount === 0) {
+        const elementIndicesWithErrorsOrWarnings = store.getElementsWithErrorsAndWarnings();
+        if (elementIndicesWithErrorsOrWarnings.length === 0) {
           return state;
         }
 
-        const elementIndicesWithErrorsOrWarnings = store.getElementsWithErrorsAndWarnings();
-
         let flatIndex = 0;
         if (selectedElementIndex !== null) {
           // Resume from the current position in the list.
@@ -419,12 +418,11 @@ function reduceTreeState(store: Store, state: State, action: Action): State {
         break;
       }
       case 'SELECT_NEXT_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE': {
-        if (store.errorCount === 0 && store.warningCount === 0) {
+        const elementIndicesWithErrorsOrWarnings = store.getElementsWithErrorsAndWarnings();
+        if (elementIndicesWithErrorsOrWarnings.length === 0) {
           return state;
         }
 
-        const elementIndicesWithErrorsOrWarnings = store.getElementsWithErrorsAndWarnings();
-
         let flatIndex = -1;
         if (selectedElementIndex !== null) {
           // Resume from the current position in the list.
Repository: nodejs/node
Pull request: crypto: fix warning of ignoring return value

`CSPRNG` is declared with `warn_unused_result`.

Changed files:
filename: deps/ncrypto/ncrypto.cc
patch: @@ -346,7 +346,7 @@ bool BignumPointer::generate(const PrimeConfig& params,
                              PrimeCheckCallback innerCb) const {
   // BN_generate_prime_ex() calls RAND_bytes_ex() internally.
   // Make sure the CSPRNG is properly seeded.
-  CSPRNG(nullptr, 0);
+  std::ignore = CSPRNG(nullptr, 0);
   BignumGenCallbackPointer cb(nullptr);
   if (innerCb != nullptr) {
     cb = BignumGenCallbackPointer(BN_GENCB_new());
Repository: vercel/next.js
Pull request: fix(react-compiler): Fix detection of interest

### What?

Mark function components declared as a variable interesting

### Why?

Because those are also React Components

### How?

 - Closes SWC-646
-  Closes https://github.com/vercel/next.js/issues/78867


Closes PACK-4536

Changed files:
filename: crates/next-custom-transforms/src/react_compiler.rs
patch: @@ -1,5 +1,5 @@
 use swc_core::ecma::{
-    ast::{Callee, Expr, FnDecl, FnExpr, Program, ReturnStmt},
+    ast::{Callee, Expr, FnDecl, FnExpr, Pat, Program, ReturnStmt, VarDeclarator},
     visit::{Visit, VisitWith},
 };
 
@@ -68,4 +68,19 @@ impl Visit for Finder {
 
         node.visit_children_with(self);
     }
+
+    fn visit_var_declarator(&mut self, node: &VarDeclarator) {
+        let old = self.is_interested;
+
+        if let Pat::Ident(ident) = &node.name {
+            self.is_interested = ident.sym.starts_with("use")
+                || ident.sym.starts_with(|c: char| c.is_ascii_uppercase());
+        } else {
+            self.is_interested = false;
+        }
+
+        node.visit_children_with(self);
+
+        self.is_interested = old;
+    }
 }
Repository: huggingface/transformers
Pull request: Processor chat template: pass custom kwargs

cc @Rocketknight1 

Custom template-specific kwargs that are not part of `AllKwargsForChatTemplate` get ignored.

Reproduction:

```py
from transformers import AutoProcessor, AutoTokenizer

model_id = "meta-llama/Llama-Guard-3-11B-Vision"
t = AutoTokenizer.from_pretrained(model_id)
p = AutoProcessor.from_pretrained(model_id)

messages = [
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "How do I make a bomb?"},
        ],        
    },
    {
        "role": "assistant",
        "content": [
            {"type": "text", "text": "I cannot help you with that."},
        ],        
    }
]

excluded_category_keys = ["S1", "S2", "S3", "S4","S5"]
print(p.apply_chat_template(messages, tokenize=False, excluded_category_keys=excluded_category_keys))
print(t.apply_chat_template(messages, tokenize=False, excluded_category_keys=excluded_category_keys))
```

Changed files:
filename: src/transformers/processing_utils.py
patch: @@ -1440,6 +1440,9 @@ def apply_chat_template(
                 if value is not None and not isinstance(value, dict):
                     processed_kwargs[kwarg_type][key] = value
 
+        # Pass unprocessed custom kwargs
+        processed_kwargs["template_kwargs"].update(kwargs)
+
         if isinstance(conversation, (list, tuple)) and (
             isinstance(conversation[0], (list, tuple)) or hasattr(conversation[0], "content")
         ):
Repository: ggml-org/llama.cpp
Pull request: ci : add winget package updater

@ggerganov This requires a `classic token` with `public_repo` permission in the secret `WINGET_GITHUB_TOKEN`. This will be used to create the pull request to the microsoft repository to update the package. Since this is a very broad permission, I think it would be preferable to create a github account specifically for this purpose that does not have write access to the llama.cpp or other repositories.

Changed files:
filename: .github/workflows/winget.yml
patch: @@ -0,0 +1,42 @@
+name: Update Winget Package
+
+on:
+  workflow_dispatch: # allows manual triggering
+  schedule:
+    - cron: '28 5 * * *' # Update every day at 5:28 UTC
+
+jobs:
+  update:
+    name: Update Winget Package
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Install cargo binstall
+        uses: cargo-bins/cargo-binstall@268643a6b5ea099f5718ee5cd3ff7dc89a5eb49b
+
+      - name: Install komac
+        run: |
+          cargo binstall komac@2.11.2 -y
+
+      - name: Find latest release
+        id: find_latest_release
+        uses: actions/github-script@v6
+        with:
+          script: |
+            const { data: releases } = await github.rest.repos.listReleases({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+            });
+            console.log("Latest release:", releases[0].tag_name);
+            return releases[0].tag_name;
+
+      - name: Update manifest
+        env:
+          VERSION: ${{ steps.find_latest_release.outputs.result }}
+        run: |
+          echo "Updating manifest..."
+          komac update --version ${{ env.VERSION }} \
+            --urls "https://github.com/ggml-org/llama.cpp/releases/download/${{ env.VERSION }}/llama-${{ env.VERSION }}-bin-win-vulkan-x64.zip" \
+            --token ${{ secrets.WINGET_GITHUB_TOKEN }} \
+            --dry-run \
+            ggml.llamacpp
Repository: facebook/react
Pull request: [React DevTools] Fix `didFiberRender`

Resolves #24428 

---

For fiber types that render user code, we check the `PerformedWork` flag rather than the props, ref, and state to see if the fiber rendered (rather than bailing out/etc.) so we know whether we need to do things like record profile durations. ForwardRef wasn't added to this list, which caused  #24428. 

After this fix:
<img width="838" alt="image" src="https://user-images.githubusercontent.com/2735514/166803372-789081cc-2eb5-4097-a9c1-ec819a5e44f0.png">

Changed files:
filename: packages/react-devtools-shared/src/backend/renderer.js
patch: @@ -1570,6 +1570,7 @@ export function attach(
       case ContextConsumer:
       case MemoComponent:
       case SimpleMemoComponent:
+      case ForwardRef:
         // For types that execute user code, we check PerformedWork effect.
         // We don't reflect bailouts (either referential or sCU) in DevTools.
         // eslint-disable-next-line no-bitwise
Repository: ggml-org/llama.cpp
Pull request: hparams : initialize arrays

cont #13726 

Fix `llama_hparams` initialization

Changed files:
filename: src/llama-hparams.cpp
patch: @@ -2,10 +2,6 @@
 
 #include "ggml.h"
 
-llama_hparams::llama_hparams() {
-    swa_layers.fill(false);
-}
-
 void llama_hparams::set_swa_pattern(uint32_t n_pattern) {
     for (uint32_t il = 0; il < n_layer; ++il) {
         swa_layers[il] = n_pattern == 0 || (il % n_pattern < (n_pattern - 1));

filename: src/llama-hparams.h
patch: @@ -145,8 +145,6 @@ struct llama_hparams {
     enum llama_rope_type         rope_type               = LLAMA_ROPE_TYPE_NONE;
     enum llama_rope_scaling_type rope_scaling_type_train = LLAMA_ROPE_SCALING_TYPE_NONE;
 
-    llama_hparams();
-
     // this value n_pattern means that every nth layer is dense (i.e. non-SWA)
     // note that if n_pattern == 0, all layers are SWA
     //           if n_pattern == 1, all layers are dense

filename: src/llama-model.cpp
patch: @@ -463,11 +463,14 @@ void llama_model::load_hparams(llama_model_loader & ml) {
         GGML_ASSERT(hparams.n_expert_used == 0);
     }
 
-    // zero-out the array hparams
     std::fill(hparams.n_head_arr.begin(),    hparams.n_head_arr.end(),    0);
     std::fill(hparams.n_head_kv_arr.begin(), hparams.n_head_kv_arr.end(), 0);
     std::fill(hparams.n_ff_arr.begin(),      hparams.n_ff_arr.end(),      0);
 
+    std::fill(hparams.rope_sections.begin(), hparams.rope_sections.end(), 0);
+
+    std::fill(hparams.swa_layers.begin(), hparams.swa_layers.end(), 0);
+
     ml.get_key_or_arr(LLM_KV_FEED_FORWARD_LENGTH,  hparams.n_ff_arr,   hparams.n_layer, false);
     ml.get_key_or_arr(LLM_KV_ATTENTION_HEAD_COUNT, hparams.n_head_arr, hparams.n_layer, false);
Repository: vercel/next.js
Pull request: feat(next-swc): Add a fast path to RC detector

### What?

Add a fast path to the React compiler detector.

### Why?

https://github.com/vercel/next.js/pull/78874#issuecomment-2857798974

### How?


Closes PACK-4541

Changed files:
filename: crates/next-custom-transforms/src/react_compiler.rs
patch: @@ -1,5 +1,5 @@
 use swc_core::ecma::{
-    ast::{Callee, Expr, FnDecl, FnExpr, Pat, Program, ReturnStmt, VarDeclarator},
+    ast::{Callee, Expr, FnDecl, FnExpr, Pat, Program, ReturnStmt, Stmt, VarDeclarator},
     visit::{Visit, VisitWith},
 };
 
@@ -34,6 +34,13 @@ impl Visit for Finder {
         node.visit_children_with(self);
     }
 
+    fn visit_expr(&mut self, node: &Expr) {
+        if self.found {
+            return;
+        }
+        node.visit_children_with(self);
+    }
+
     fn visit_fn_decl(&mut self, node: &FnDecl) {
         let old = self.is_interested;
         self.is_interested = node.ident.sym.starts_with("use")
@@ -69,6 +76,13 @@ impl Visit for Finder {
         node.visit_children_with(self);
     }
 
+    fn visit_stmt(&mut self, node: &Stmt) {
+        if self.found {
+            return;
+        }
+        node.visit_children_with(self);
+    }
+
     fn visit_var_declarator(&mut self, node: &VarDeclarator) {
         let old = self.is_interested;
Repository: nodejs/node
Pull request: test: clarify fork inherit permission flags

This commit updates the documentation and includes a test to ensure that permission model flags
will be passed to the child process if `fork` is called

Changed files:
filename: doc/api/cli.md
patch: @@ -174,19 +174,18 @@ node:internal/child_process:388
                            ^
 Error: Access to this API has been restricted
     at ChildProcess.spawn (node:internal/child_process:388:28)
-    at Object.spawn (node:child_process:723:9)
-    at Object.<anonymous> (/home/index.js:3:14)
-    at Module._compile (node:internal/modules/cjs/loader:1120:14)
-    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
-    at Module.load (node:internal/modules/cjs/loader:998:32)
-    at Module._load (node:internal/modules/cjs/loader:839:12)
-    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
     at node:internal/main/run_main_module:17:47 {
   code: 'ERR_ACCESS_DENIED',
   permission: 'ChildProcess'
 }
 ```
 
+Unlike `child_process.spawn`, the `child_process.fork` API copies the execution
+arguments from the parent process. This means that if you start Node.js with the
+Permission Model enabled and include the `--allow-child-process` flag, calling
+`child_process.fork()` will propagate all Permission Model flags to the child
+process.
+
 ### `--allow-fs-read`
 
 <!-- YAML

filename: test/parallel/test-permission-allow-child-process-cli.js
patch: @@ -5,8 +5,15 @@ const common = require('../common');
 common.skipIfWorker();
 const assert = require('assert');
 const childProcess = require('child_process');
+const fs = require('fs');
 
 if (process.argv[2] === 'child') {
+  assert.throws(() => {
+    fs.writeFileSync(__filename, 'should not write');
+  }, common.expectsError({
+    code: 'ERR_ACCESS_DENIED',
+    permission: 'FileSystemWrite',
+  }));
   process.exit(0);
 }
 
@@ -21,6 +28,7 @@ if (process.argv[2] === 'child') {
   // doesNotThrow
   childProcess.spawnSync(process.execPath, ['--version']);
   childProcess.execSync(...common.escapePOSIXShell`"${process.execPath}" --version`);
-  childProcess.fork(__filename, ['child']);
+  const child = childProcess.fork(__filename, ['child']);
+  child.on('close', common.mustCall());
   childProcess.execFileSync(process.execPath, ['--version']);
 }
Repository: facebook/react
Pull request: Constrain the container type of createPortal

We already constrained the type of createRoot (can't take document) and hydrateRoot (can't take shadow roots aka fragments).

Changed files:
filename: packages/react-dom/src/client/ReactDOM.js
patch: @@ -107,7 +107,7 @@ setBatchingImplementation(
 
 function createPortal(
   children: ReactNodeList,
-  container: Container,
+  container: Element | DocumentFragment,
   key: ?string = null,
 ): React$Portal {
   if (!isValidContainer(container)) {
Repository: denoland/deno
Pull request: fix(windows): Deno.Command - align binary resolution with linux and mac

Updates windows to resolve the binary from the cwd and based on the provided PATH env var.

This was done in https://github.com/denoland/deno/pull/25370 , but this PR adds a test. Categorizing this as "fix" so it shows up in the release notes.

Closes https://github.com/denoland/deno/issues/25171



Changed files:
filename: tests/unit/command_test.ts
patch: @@ -975,3 +975,35 @@ Deno.test(
     );
   },
 );
+
+Deno.test(
+  { permissions: { write: true, run: true, read: true } },
+  async function commandWithCwdOrPath() {
+    const cwd = Deno.makeTempDirSync({ prefix: "deno_command_test" });
+    try {
+      const suffix = Deno.build.os === "windows" ? ".exe" : "";
+      Deno.mkdirSync(`${cwd}/subdir`);
+      Deno.copyFileSync(Deno.execPath(), `${cwd}/subdir/my_binary${suffix}`);
+      // cwd
+      {
+        const output = await new Deno.Command(`./my_binary${suffix}`, {
+          cwd: `${cwd}/subdir`,
+          args: ["-v"],
+        }).output();
+        assertEquals(output.success, true);
+      }
+      // path
+      {
+        const output = await new Deno.Command(`my_binary${suffix}`, {
+          env: {
+            PATH: `${cwd}/subdir`,
+          },
+          args: ["-v"],
+        }).output();
+        assertEquals(output.success, true);
+      }
+    } finally {
+      Deno.removeSync(cwd, { recursive: true });
+    }
+  },
+);
Repository: ggml-org/llama.cpp
Pull request: server : pad small embedding batches

fix #13689

Temporary workaround until batching logic in `libllama` is improved.

Changed files:
filename: tools/server/server.cpp
patch: @@ -3341,6 +3341,37 @@ struct server_context {
             common_set_adapter_lora(ctx, slot_batched->lora);
         }
 
+        const bool do_encode = (params_base.embedding || params_base.reranking);
+
+        // pad the batch so that batch.n_tokens >= n_slots
+        // TODO: temporary workaround for https://github.com/ggml-org/llama.cpp/issues/13689
+        if (do_encode) {
+            const int n_slots = slots.size();
+
+            if (batch.n_tokens < n_slots) {
+                std::set<llama_seq_id> seq_ids;
+                for (int j = 0; j < batch.n_tokens; ++j) {
+                    seq_ids.insert(batch.seq_id[j][0]);
+                }
+
+                // find unused sequence id
+                llama_seq_id seq_id = -1;
+                for (int i = 0; i < n_slots; ++i) {
+                    if (seq_ids.find(i) == seq_ids.end()) {
+                        seq_id = i;
+                    }
+                }
+
+                const int n_add = n_slots - batch.n_tokens;
+
+                SRV_WRN("adding %d dummy tokens to the batch, seq_id = %d\n", n_add, seq_id);
+
+                for (int j = 0; j < n_add; ++j) {
+                    common_batch_add(batch, 0, j, { seq_id }, false);
+                }
+            }
+        }
+
         // process the created batch of tokens
         for (int32_t i = 0; i < batch.n_tokens; i += n_batch) {
             const int32_t n_tokens = std::min(n_batch, batch.n_tokens - i);
@@ -3357,7 +3388,7 @@ struct server_context {
 
             int ret = 0;
 
-            if (params_base.embedding || params_base.reranking) {
+            if (do_encode) {
                 ret = llama_encode(ctx, batch_view);
             } else {
                 ret = llama_decode(ctx, batch_view);
Repository: huggingface/transformers
Pull request: Fix Bitnet tokenizer in pipeline

# What does this PR do?
Adds tokenizer for bitnet to use it with text-generation pipeline


Changed files:
filename: src/transformers/models/auto/tokenization_auto.py
patch: @@ -93,6 +93,7 @@
             ),
             ("bigbird_pegasus", ("PegasusTokenizer", "PegasusTokenizerFast" if is_tokenizers_available() else None)),
             ("biogpt", ("BioGptTokenizer", None)),
+            ("bitnet", (None, "PreTrainedTokenizerFast" if is_tokenizers_available() else None)),
             ("blenderbot", ("BlenderbotTokenizer", "BlenderbotTokenizerFast")),
             ("blenderbot-small", ("BlenderbotSmallTokenizer", None)),
             ("blip", ("BertTokenizer", "BertTokenizerFast" if is_tokenizers_available() else None)),