helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Simplify `discreteUpdates`

Now that discrete updates are flushed synchronously in a microtask, the `discreteUpdates` method used by our event system is only an optimization to save us from having to check `window.event.type` on every update. So we should be able to remove the extra logic.

Assuming this lands successfully, we can remove `batchedEventUpdates` and probably inline `discreteUpdates` into the renderer, like we do for continuous updates.

Changed files:
filename: packages/react-dom/src/events/ReactDOMUpdateBatching.js
patch: @@ -24,10 +24,11 @@ let discreteUpdatesImpl = function(fn, a, b, c, d) {
   return fn(a, b, c, d);
 };
 let flushDiscreteUpdatesImpl = function() {};
-let batchedEventUpdatesImpl = batchedUpdatesImpl;
+// TODO: Remove references to batchedEventUpdates
+// let batchedEventUpdatesImpl = batchedUpdatesImpl;
 
 let isInsideEventHandler = false;
-let isBatchingEventUpdates = false;
+// let isBatchingEventUpdates = false;
 
 function finishEventHandler() {
   // Here we wait until all updates have propagated, which is important
@@ -46,48 +47,27 @@ function finishEventHandler() {
   }
 }
 
-export function batchedUpdates(fn, bookkeeping) {
+export function batchedUpdates(fn, a, b) {
   if (isInsideEventHandler) {
     // If we are currently inside another batch, we need to wait until it
     // fully completes before restoring state.
-    return fn(bookkeeping);
+    return fn(a, b);
   }
   isInsideEventHandler = true;
   try {
-    return batchedUpdatesImpl(fn, bookkeeping);
+    return batchedUpdatesImpl(fn, a, b);
   } finally {
     isInsideEventHandler = false;
     finishEventHandler();
   }
 }
 
-export function batchedEventUpdates(fn, a, b) {
-  if (isBatchingEventUpdates) {
-    // If we are currently inside another batch, we need to wait until it
-    // fully completes before restoring state.
-    return fn(a, b);
-  }
-  isBatchingEventUpdates = true;
-  try {
-    return batchedEventUpdatesImpl(fn, a, b);
-  } finally {
-    isBatchingEventUpdates = false;
-    finishEventHandler();
-  }
-}
+// TODO: Remove references to batchedEventUpdates
+export const batchedEventUpdates = batchedUpdates;
 
 // TODO: Replace with flushSync
 export function discreteUpdates(fn, a, b, c, d) {
-  const prevIsInsideEventHandler = isInsideEventHandler;
-  isInsideEventHandler = true;
-  try {
-    return discreteUpdatesImpl(fn, a, b, c, d);
-  } finally {
-    isInsideEventHandler = prevIsInsideEventHandler;
-    if (!isInsideEventHandler) {
-      finishEventHandler();
-    }
-  }
+  return discreteUpdatesImpl(fn, a, b, c, d);
 }
 
 export function setBatchingImplementation(
@@ -99,5 +79,6 @@ export function setBatchingImplementation(
   batchedUpdatesImpl = _batchedUpdatesImpl;
   discreteUpdatesImpl = _discreteUpdatesImpl;
   flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
-  batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
+  // TODO: Remove references to batchedEventUpdates
+  // batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
 }
Repository: denoland/deno
Pull request: fix(ext/web): pass `createImageBitmap` when the argument type is `Blob`

fixes https://github.com/denoland/deno/issues/22649

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->


Changed files:
filename: ext/canvas/01_image.js
patch: @@ -238,7 +238,9 @@ function createImageBitmap(
           "InvalidStateError",
         );
       }
-      const { data: imageData, width, height } = op_image_decode_png(data);
+      const { data: imageData, width, height } = op_image_decode_png(
+        new Uint8Array(data),
+      );
       const processedImage = processImage(
         imageData,
         width,

filename: ext/canvas/lib.rs
patch: @@ -130,7 +130,8 @@ fn op_image_decode_png(#[buffer] buf: &[u8]) -> Result<DecodedPng, AnyError> {
     )));
   }
 
-  let mut png_data = Vec::with_capacity(png.total_bytes() as usize);
+  // read_image will assert that the buffer is the correct size, so we need to fill it with zeros
+  let mut png_data = vec![0_u8; png.total_bytes() as usize];
 
   png.read_image(&mut png_data)?;
 

filename: tests/unit/image_bitmap_test.ts
patch: @@ -90,3 +90,14 @@ Deno.test(async function imageBitmapFlipY() {
     1, 0, 0, 1,   2, 0, 0, 1,   3, 0, 0, 1,
   ]));
 });
+
+Deno.test(async function imageBitmapFromBlob() {
+  const path = "tests/testdata/image/1x1-white.png";
+  const imageData = new Blob([await Deno.readFile(path)], {
+    type: "image/png",
+  });
+  const imageBitmap = await createImageBitmap(imageData);
+  // @ts-ignore: Deno[Deno.internal].core allowed
+  // deno-fmt-ignore
+  assertEquals(Deno[Deno.internal].getBitmapData(imageBitmap), new Uint8Array([255,255,255,255]));
+});
Repository: huggingface/transformers
Pull request: Fix test isolation for clear_import_cache utility

## Problem
The `test_clear_import_cache()` test in `tests/utils/test_import_utils.py` is affecting the state of subsequent tests, causing failures in the test suite. This is happening because the test modifies the global module cache without properly restoring it.

## Solution
Updated the test to:
1. Save the initial state of all transformers modules before running the test
2. Run the test to verify `clear_import_cache()` functionality
3. Restore the initial state after the test completes, including proper handling of `_LazyModule` instances

The core functionality of `clear_import_cache()` remains unchanged - this fix only addresses test isolation.

Edit : #36334

## Screenshots
<img width="780" alt="Screenshot 2025-02-22 at 4 43 58 PM" src="https://github.com/user-attachments/assets/c539e8f9-c800-4366-a869-35dd5c859e01" />

cc @dvrogozh

Changed files:
filename: tests/utils/test_import_utils.py
patch: @@ -1,23 +1,26 @@
 import sys
 
+from transformers.testing_utils import run_test_using_subprocess
 from transformers.utils.import_utils import clear_import_cache
 
 
+@run_test_using_subprocess
 def test_clear_import_cache():
-    # Import some transformers modules
+    """Test the clear_import_cache function."""
 
-    # Get initial module count
+    # Save initial state
     initial_modules = {name: mod for name, mod in sys.modules.items() if name.startswith("transformers.")}
+    assert len(initial_modules) > 0, "No transformers modules loaded before test"
 
-    # Verify we have some modules loaded
-    assert len(initial_modules) > 0
-
-    # Clear cache
+    # Execute clear_import_cache() function
     clear_import_cache()
 
-    # Check modules were removed
+    # Verify modules were removed
     remaining_modules = {name: mod for name, mod in sys.modules.items() if name.startswith("transformers.")}
-    assert len(remaining_modules) < len(initial_modules)
+    assert len(remaining_modules) < len(initial_modules), "No modules were removed"
+
+    # Import and verify module exists
+    from transformers.models.auto import modeling_auto
 
-    # Verify we can reimport
-    assert "transformers" in sys.modules
+    assert "transformers.models.auto.modeling_auto" in sys.modules
+    assert modeling_auto.__name__ == "transformers.models.auto.modeling_auto"
Repository: facebook/react
Pull request: build-combined: Fix failures  when renaming across devices

## Summary

Fixes `yarn build-combined` failing if cloned repository is on another "device" than `/tmp`.

## Test Plan

- [x] CI green

## Context

`fs.renameSync` is disallowed<sup>1</sup> if source and destination are on different devices e.g. the default partition for Ubuntu mounts `/home` and `/` (and therefore `/tmp` on different partitions.

`moveSync` (from `fs-extra`) uses `renameSync` by default and falls back to copying if source and destination are on different devices.

<sup>1</sup>Example failure

```
Error: EXDEV: cross-device link not permitted, rename './build' -> '/tmp/tmp-12886027DtsEsr78bYo'
```



Changed files:
filename: scripts/rollup/build-all-release-channels.js
patch: @@ -3,6 +3,7 @@
 /* eslint-disable no-for-of-loops/no-for-of-loops */
 
 const fs = require('fs');
+const fse = require('fs-extra');
 const {spawnSync} = require('child_process');
 const path = require('path');
 const tmp = require('tmp');
@@ -50,13 +51,13 @@ if (process.env.CIRCLE_NODE_TOTAL) {
   const stableVersion = '0.0.0-' + sha;
   buildForChannel('stable', '', '');
   const stableDir = tmp.dirSync().name;
-  fs.renameSync('./build', stableDir);
+  crossDeviceRenameSync('./build', stableDir);
   processStable(stableDir, stableVersion);
 
   const experimentalVersion = '0.0.0-experimental-' + sha;
   buildForChannel('experimental', '', '');
   const experimentalDir = tmp.dirSync().name;
-  fs.renameSync('./build', experimentalDir);
+  crossDeviceRenameSync('./build', experimentalDir);
   processExperimental(experimentalDir, experimentalVersion);
 
   // Then merge the experimental folder into the stable one. processExperimental
@@ -68,7 +69,7 @@ if (process.env.CIRCLE_NODE_TOTAL) {
   // Now restore the combined directory back to its original name
   // TODO: Currently storing artifacts as `./build2` so that it doesn't conflict
   // with old build job. Remove once we migrate rest of build/test pipeline.
-  fs.renameSync(stableDir, './build2');
+  crossDeviceRenameSync(stableDir, './build2');
 }
 
 function buildForChannel(channel, nodeTotal, nodeIndex) {
@@ -139,6 +140,10 @@ function processExperimental(buildDir, version) {
   }
 }
 
+function crossDeviceRenameSync(source, destination) {
+  return fse.moveSync(source, destination, {overwrite: true});
+}
+
 function updatePackageVersions(modulesDir, version) {
   const allReactModuleNames = fs.readdirSync('packages');
   for (const moduleName of fs.readdirSync(modulesDir)) {
Repository: vercel/next.js
Pull request: fix(jest): stricter regex for 'server-only' in default config

NextJest default `moduleNameMapper` configuration for `server-only` matches any string that contains this substring, causing mocks of matching dependencies to overwrite each others and the empty mock for `import 'server-only';`. This changes makes the regex for the module name more strict to ensure only the full string `server-only` is a match.

### Why?

On my project, we thought it'd be a good idea to store our server-only files under the directory `@/app/lib/server-only`. Unfortunately, this made testing with Jest difficult due to `nextJest`'s default configuration for `server-only`. Given a test file with:

```typescript
jest.mock('@/app/lib/server-only/one, () => ({
  fnOne: jest.fn(),
}));
jest.mock('@/app/lib/server-only/two, () => ({
  fnTwo: jest.fn(),
}));
```

The mocks for the dependency `@/app/lib/server-only/two` would overwrite the mock of `@/app/lib/server-only/one` (that was overwriting the empty mock for `server-only`) and thus `fnOne` would be `undefined`.

In our project, we've currently fixed the issue by patching the configuration generated by `nextJest` using the stricter regexp in this PR:

```typescript
// ...At the end of jest.config.ts
module.exports = async () => {
  const jestConfig = await createJestConfig(config)();
  if (
    typeof jestConfig.moduleNameMapper !== 'undefined' &&
    'server-only' in jestConfig.moduleNameMapper
  ) {
    const value = jestConfig.moduleNameMapper['server-only'];
    jestConfig.moduleNameMapper['^server-only$'] = value;
    delete jestConfig.moduleNameMapper['server-only'];
  }
  return jestConfig;
};
```

## Verifications

I've checked that `pnpm build` and `pnpm test-unit` were unaffected. This is the result of `pnpm test-unit`:

```
Test Suites: 199 passed, 199 total
Tests:       2 skipped, 1312 passed, 1314 total
Snapshots:   188 passed, 188 total
Time:        11.697 s
Ran all test suites matching /test\/unit\/|packages\/next\/|packages\/font/i.
```

Changed files:
filename: packages/next/src/build/jest/jest.ts
patch: @@ -141,7 +141,7 @@ export default function nextJest(options: { dir?: string } = {}) {
           // Handle next/font
           'next/font/(.*)': require.resolve('./__mocks__/nextFontMock.js'),
           // Disable server-only
-          'server-only': require.resolve('./__mocks__/empty.js'),
+          '^server-only$': require.resolve('./__mocks__/empty.js'),
 
           // custom config comes last to ensure the above rules are matched,
           // fixes the case where @pages/(.*) -> src/pages/$! doesn't break
Repository: ggml-org/llama.cpp
Pull request: fix inverted strcmp checking for `quantize --keep-split`


Changed files:
filename: examples/quantize/quantize.cpp
patch: @@ -284,7 +284,7 @@ int main(int argc, char ** argv) {
             } else {
                 usage(argv[0]);
             }
-        } else if (strcmp(argv[arg_idx], "--keep-split")) {
+        } else if (strcmp(argv[arg_idx], "--keep-split") == 0) {
             params.keep_split = true;
         } else {
             usage(argv[0]);
Repository: nodejs/node
Pull request: tools: run daily WPT.fyi report on all supported releases

This updates the [Daily WPT report](https://github.com/nodejs/node/actions/workflows/daily-wpt-fyi.yml) job to always test on all releases that are not EOL + latest nightly and it uses the [schedule](https://raw.githubusercontent.com/nodejs/Release/refs/heads/main/schedule.json) from https://github.com/nodejs/Release/ to collect the versions.

Example output from the processed schedule given $now is `2024-10-31`

```
[
  18,
  20,
  22,
  23,
  "latest-nightly"
]
```

---

This resolves an issue with the delay coming from https://github.com/actions/node-versions manifest that `actions/setup-node` uses as well as actually not cutting off reporting on lts/-2 so long as it's still not EOL presented in the recent run - https://github.com/nodejs/node/actions/runs/11604060841 - where 18 is tested but 22 is not yet, but when https://github.com/actions/node-versions/pull/191 is merged 22 will be tested but 18 will not.

Changed files:
filename: .github/workflows/daily-wpt-fyi.yml
patch: @@ -6,11 +6,6 @@ name: Daily WPT report
 
 on:
   workflow_dispatch:
-    inputs:
-      node-versions:
-        description: Node.js versions (as supported by actions/setup-node) to test as JSON array
-        required: false
-        default: '["current", "lts/*", "lts/-1"]'
   schedule:
     # This is 20 minutes after `epochs/daily` branch is triggered to be created
     # in WPT repo.
@@ -24,11 +19,22 @@ permissions:
   contents: read
 
 jobs:
-  report:
+  collect-versions:
     if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
+    runs-on: ubuntu-latest
+    outputs:
+      matrix: ${{ steps.query.outputs.matrix }}
+    steps:
+      - id: query
+        run: |
+          matrix=$(curl -s https://raw.githubusercontent.com/nodejs/Release/refs/heads/main/schedule.json | jq --arg now "$(date +%Y-%m-%d)" '[with_entries(select(.value.end > $now and .value.start < $now)) | keys[] | ltrimstr("v") | tonumber] + ["latest-nightly"]')
+          echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
+  report:
+    needs:
+      - collect-versions
     strategy:
       matrix:
-        node-version: ${{ fromJSON(github.event.inputs.node-versions || '["latest-nightly", "current", "lts/*", "lts/-1"]') }}
+        node-version: ${{ fromJSON(needs.collect-versions.outputs.matrix) }}
       fail-fast: false
     runs-on: ubuntu-latest
     steps:
Repository: denoland/deno
Pull request: fix(runtime): allow r/w access to /etc without --allow-all

This is not a special path that can be used to escalate or bypass Deno permissions, such as `--allow-env`.

Related #23703

Changed files:
filename: runtime/permissions/lib.rs
patch: @@ -1691,19 +1691,10 @@ impl PermissionsContainer {
           self.check_was_allow_all_flag_passed().map_err(error_all)?;
         }
       }
-      if path.starts_with("/etc") {
-        self.check_was_allow_all_flag_passed().map_err(error_all)?;
-      }
     } else if cfg!(unix) {
       if path.starts_with("/dev") {
         self.check_was_allow_all_flag_passed().map_err(error_all)?;
       }
-      if path.starts_with("/etc") {
-        self.check_was_allow_all_flag_passed().map_err(error_all)?;
-      }
-      if path.starts_with("/private/etc") {
-        self.check_was_allow_all_flag_passed().map_err(error_all)?;
-      }
     } else if cfg!(target_os = "windows") {
       fn is_normalized_windows_drive_path(path: &Path) -> bool {
         let s = path.as_os_str().as_encoded_bytes();

filename: tests/specs/permission/special/main.js
patch: @@ -4,8 +4,8 @@
 const testCases = [
   // Allowed, safe
   [["darwin", "linux"], null, "/dev/null"],
+  [["darwin", "linux"], null, "/etc/passwd"],
   // Denied, requires `--allow-all`
-  [["darwin", "linux"], /PermissionDenied/, "/etc/hosts"],
   [["darwin", "linux"], /PermissionDenied/, "/dev/ptmx"],
   [["linux"], /PermissionDenied/, "/proc/self/environ"],
   [["linux"], /PermissionDenied/, "/proc/self/mem"],
Repository: nodejs/node
Pull request: tools: compact jq output in daily-wpt-fyi.yml action

A quick followup to #55619, makes the jq output compact so that it can be processed by the actions runner properly.

Fixes https://github.com/nodejs/node/actions/runs/11645595593

Changed files:
filename: .github/workflows/daily-wpt-fyi.yml
patch: @@ -27,7 +27,7 @@ jobs:
     steps:
       - id: query
         run: |
-          matrix=$(curl -s https://raw.githubusercontent.com/nodejs/Release/refs/heads/main/schedule.json | jq --arg now "$(date +%Y-%m-%d)" '[with_entries(select(.value.end > $now and .value.start < $now)) | keys[] | ltrimstr("v") | tonumber] + ["latest-nightly"]')
+          matrix=$(curl -s https://raw.githubusercontent.com/nodejs/Release/refs/heads/main/schedule.json | jq -c --arg now "$(date +%Y-%m-%d)" '[with_entries(select(.value.end > $now and .value.start < $now)) | keys[] | ltrimstr("v") | tonumber] + ["latest-nightly"]')
           echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
   report:
     needs:
Repository: vercel/next.js
Pull request: Fix: RESTORE_ACTION should not be thenable

Respect sync/async actions by reducer. RESTORE_ACTION is sync action so should not return a `thenable`.

Changed files:
filename: packages/next/src/client/components/app-router-instance.ts
patch: @@ -199,7 +199,7 @@ export function createMutableActionQueue(
     state: initialState,
     dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>
       dispatchAction(actionQueue, payload, setState),
-    action: async (state: AppRouterState, action: ReducerActions) => {
+    action: (state: AppRouterState, action: ReducerActions) => {
       const result = reducer(state, action)
       return result
     },
Repository: huggingface/transformers
Pull request: Add Space to Bitsandbytes doc

# What does this PR do?
Add the space link to Bitsandbytes doc, and overview quantization doc

Changed files:
filename: docs/source/en/quantization/bitsandbytes.md
patch: @@ -20,7 +20,10 @@ rendered properly in your Markdown viewer.
 
 [LLM.int8()](https://hf.co/papers/2208.07339) is a quantization method that aims to make large language model inference more accessible without significant degradation. Unlike naive 8-bit quantization, which can result in loss of critical information and accuracy, LLM.int8() dynamically adapts to ensure sensitive components of the computation retain higher precision when needed.
 
-QLoRA, or 4-bit quantization, compresses a model even further to 4-bits and inserts a small set of trainable low-rank adaptation (LoRA) weights to allowing training.
+QLoRA, or 4-bit quantization, compresses a model even further to 4-bits and inserts a small set of trainable low-rank adaptation (LoRA) weights to allowing training. 
+
+> **Note:** For a user-friendly quantization experience, you can use the `bitsandbytes` [community space](https://huggingface.co/spaces/bnb-community/bnb-my-repo).
+
 
 Run the command below to install bitsandbytes.
 

filename: docs/source/en/quantization/overview.md
patch: @@ -46,4 +46,13 @@ Use the Space below to help you pick a quantization method depending on your har
 If you are new to quantization, we recommend checking out these beginner-friendly quantization courses in collaboration with DeepLearning.AI.
 
 * [Quantization Fundamentals with Hugging Face](https://www.deeplearning.ai/short-courses/quantization-fundamentals-with-hugging-face/)
-* [Quantization in Depth](https://www.deeplearning.ai/short-courses/quantization-in-depth
\ No newline at end of file
+* [Quantization in Depth](https://www.deeplearning.ai/short-courses/quantization-in-depth)
+
+## User-Friendly Quantization Tools
+
+If you are looking for a user-friendly quantization experience, you can use the following community spaces and notebooks: 
+
+* [Bitsandbytes Space](https://huggingface.co/spaces/bnb-community/bnb-my-repo)
+* [GGUF Space](https://huggingface.co/spaces/ggml-org/gguf-my-repo)
+* [MLX Space](https://huggingface.co/spaces/mlx-community/mlx-my-repo)
+* [AuoQuant Notebook](https://colab.research.google.com/drive/1b6nqC7UZVt8bx4MksX7s656GXPM-eWw4?usp=sharing#scrollTo=ZC9Nsr9u5WhN)
\ No newline at end of file
Repository: huggingface/transformers
Pull request: One more fix for reviewer assignment

There was another bug I missed - the Github API doesn't always give start absolute paths from the root with `/`. This updated regex handles that!

Changed files:
filename: .github/scripts/assign_reviewers.py
patch: @@ -22,12 +22,16 @@
 from pathlib import Path
 
 def pattern_to_regex(pattern):
-    start_anchor = pattern.startswith("/")
-    pattern = re.escape(pattern)
+    if pattern.startswith("/"):
+        start_anchor = True
+        pattern = re.escape(pattern[1:])
+    else:
+        start_anchor = False
+        pattern = re.escape(pattern)
     # Replace `*` with "any number of non-slash characters"
     pattern = pattern.replace(r"\*", "[^/]*")
     if start_anchor:
-        pattern = "^" + pattern
+        pattern = r"^\/?" + pattern  # Allow an optional leading slash after the start of the string
     return pattern
 
 def get_file_owners(file_path, codeowners_lines):