helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: doc: rephrase dynamic import() description

The description is updated to clarify that dynamic import() is asynchronous, dynamic, and works in both CJS and ESM contexts. The new phrasing also avoids implying it is the only method for loading ES modules in CommonJS.

Fixes: https://github.com/nodejs/node/issues/59077

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/esm.md
patch: @@ -334,8 +334,9 @@ fs.readFileSync === readFileSync;
 
 ## `import()` expressions
 
-[Dynamic `import()`][] is supported in both CommonJS and ES modules. In CommonJS
-modules it can be used to load ES modules.
+[Dynamic `import()`][] provides an asynchronous way to import modules. It is
+supported in both CommonJS and ES modules, and can be used to load both CommonJS
+and ES modules.
 
 ## `import.meta`
Repository: huggingface/transformers
Pull request: improve `utils/check_bad_commit.py`

# What does this PR do?

This script (used to find which commits fail certain failing tests on our CI) fails recently, due to the fact that the warning `sys:1: DeprecationWarning: builtin type swigvarlink has no __module__ attribute` was written to `stderr` and we use `stderr` to check if there is error.

This is not a good approach, we should instead check `result.returncode`. Also a few improvements added along this here

Changed files:
filename: utils/check_bad_commit.py
patch: @@ -45,23 +45,21 @@ def create_script(target_test):
 )
 print(result.stdout)
 
-if f"PASSED {target_test}" in result.stdout:
-    print("test passed")
-    exit(0)
-elif len(result.stderr) > 0:
+if f"FAILED {target_test}" in result.stdout:
+    print("test failed")
+    exit(2)
+elif result.returncode != 0:
     if "ERROR: file or directory not found: " in result.stderr:
         print("test file or directory not found in this commit")
         exit(0)
     elif "ERROR: not found: " in result.stderr:
         print("test not found in this commit")
         exit(0)
     else:
-        print(f"pytest failed to run: {{result.stderr}}")
+        print(f"pytest gets unknown error: {{result.stderr}}")
         exit(-1)
-elif f"FAILED {target_test}" in result.stdout:
-    print("test failed")
-    exit(2)
 
+print(f"pytest runs successfully.")
 exit(0)
 """
 
@@ -103,22 +101,11 @@ def find_bad_commit(target_test, start_commit, end_commit):
     )
     print(result.stdout)
 
+    # This happens if running the script gives exit code < 0  or other issues
     if "error: bisect run failed" in result.stderr:
-        index = result.stderr.find("error: bisect run failed")
-        bash_error = result.stderr[index:]
-
-        error_msg = f"Error when running git bisect:\nbash error: {bash_error}"
-
-        pattern = "pytest failed to run: .+"
-        pytest_errors = re.findall(pattern, result.stdout)
-        if len(pytest_errors) > 0:
-            pytest_error = pytest_errors[0]
-            index = pytest_error.find("pytest failed to run: ")
-            index += len("pytest failed to run: ")
-            pytest_error = pytest_error[index:]
-            error_msg += f"pytest error: {pytest_error}"
-
-        raise ValueError(error_msg)
+        error_msg = f"Error when running git bisect:\nbash error: {result.stderr}\nbash output:\n{result.stdout}\nset `bad_commit` to `None`."
+        print(error_msg)
+        return None
 
     pattern = r"(.+) is the first bad commit"
     commits = re.findall(pattern, result.stdout)
@@ -135,6 +122,9 @@ def find_bad_commit(target_test, start_commit, end_commit):
 
 def get_commit_info(commit):
     """Get information for a commit via `api.github.com`."""
+    if commit is None:
+        return {"commit": None, "pr_number": None, "author": None, "merged_by": None}
+
     pr_number = None
     author = None
     merged_author = None
Repository: vercel/next.js
Pull request: [backport] fix: missing `next/link` types with `typedRoutes` (#82814)

backports #82814

Changed files:
filename: packages/next/src/server/lib/router-utils/typegen.ts
patch: @@ -298,6 +298,8 @@ declare module 'next' {
 }
 
 declare module 'next/link' {
+  export { useLinkStatus } from 'next/dist/client/link.js'
+
   import type { LinkProps as OriginalLinkProps } from 'next/dist/client/link.js'
   import type { AnchorHTMLAttributes, DetailedHTMLProps } from 'react'
   import type { UrlObject } from 'url'
Repository: electron/electron
Pull request: test: deflake clipboard read/write specs

Backport of #47752

See that PR for details.


Notes: none


Changed files:
filename: spec/chromium-spec.ts
patch: @@ -3278,7 +3278,12 @@ describe('navigator.clipboard.read', () => {
     await w.loadFile(path.join(fixturesPath, 'pages', 'blank.html'));
   });
 
-  const readClipboard: any = () => {
+  const readClipboard = async () => {
+    if (!w.webContents.isFocused()) {
+      const focus = once(w.webContents, 'focus');
+      w.webContents.focus();
+      await focus;
+    }
     return w.webContents.executeJavaScript(`
       navigator.clipboard.read().then(clipboard => clipboard.toString()).catch(err => err.message);
     `, true);
@@ -3296,23 +3301,15 @@ describe('navigator.clipboard.read', () => {
 
   it('returns an error when permission denied', async () => {
     session.defaultSession.setPermissionRequestHandler((wc, permission, callback) => {
-      if (permission === 'clipboard-read') {
-        callback(false);
-      } else {
-        callback(true);
-      }
+      callback(permission !== 'clipboard-read');
     });
     const clipboard = await readClipboard();
     expect(clipboard).to.contain('Read permission denied.');
   });
 
   it('returns clipboard contents when permission is granted', async () => {
     session.defaultSession.setPermissionRequestHandler((wc, permission, callback) => {
-      if (permission === 'clipboard-read') {
-        callback(true);
-      } else {
-        callback(false);
-      }
+      callback(permission === 'clipboard-read');
     });
     const clipboard = await readClipboard();
     expect(clipboard).to.not.contain('Read permission denied.');
@@ -3326,7 +3323,12 @@ describe('navigator.clipboard.write', () => {
     await w.loadFile(path.join(fixturesPath, 'pages', 'blank.html'));
   });
 
-  const writeClipboard: any = () => {
+  const writeClipboard = async () => {
+    if (!w.webContents.isFocused()) {
+      const focus = once(w.webContents, 'focus');
+      w.webContents.focus();
+      await focus;
+    }
     return w.webContents.executeJavaScript(`
       navigator.clipboard.writeText('Hello World!').catch(err => err.message);
     `, true);
@@ -3368,7 +3370,13 @@ describe('navigator.clipboard.write', () => {
 });
 
 describe('paste execCommand', () => {
-  const readClipboard: any = (w: BrowserWindow) => {
+  const readClipboard = async (w: BrowserWindow) => {
+    if (!w.webContents.isFocused()) {
+      const focus = once(w.webContents, 'focus');
+      w.webContents.focus();
+      await focus;
+    }
+
     return w.webContents.executeJavaScript(`
       new Promise((resolve) => {
         const timeout = setTimeout(() => {
Repository: ggml-org/llama.cpp
Pull request: llama: fix RPC for -fit on

Fixes https://github.com/ggml-org/llama.cpp/issues/18175 .

The problem is that `no_alloc = true` is not being handled correctly in the RPC backend.

Changed files:
filename: ggml/src/ggml-rpc/ggml-rpc.cpp
patch: @@ -583,7 +583,7 @@ static rpc_tensor serialize_tensor(const ggml_tensor * tensor) {
     if (tensor->buffer) {
         ggml_backend_buffer_t buffer = tensor->buffer;
         ggml_backend_rpc_buffer_context * ctx = (ggml_backend_rpc_buffer_context *)buffer->context;
-        result.buffer = ctx->remote_ptr;
+        result.buffer = ctx != nullptr ? ctx->remote_ptr : 0;
     } else {
         result.buffer = 0;
     }
Repository: huggingface/transformers
Pull request: Improve package version check

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/41651. In very niche cases, a package may have several distributions, leading to potential issues in our current check (if the wrong one is first). This PR fixes it by checking if a distribution of the same name exists

Changed files:
filename: src/transformers/utils/import_utils.py
patch: @@ -52,7 +52,10 @@ def _is_package_available(pkg_name: str, return_version: bool = False) -> Union[
         try:
             # importlib.metadata works with the distribution package, which may be different from the import
             # name (e.g. `PIL` is the import name, but `pillow` is the distribution name)
-            distribution_name = PACKAGE_DISTRIBUTION_MAPPING[pkg_name][0]
+            distributions = PACKAGE_DISTRIBUTION_MAPPING[pkg_name]
+            # In most cases, the packages are well-behaved and both have the same name. If it's not the case, we
+            # pick the first item of the list as best guess (it's almost always a list of length 1 anyway)
+            distribution_name = pkg_name if pkg_name in distributions else distributions[0]
             package_version = importlib.metadata.version(distribution_name)
         except importlib.metadata.PackageNotFoundError:
             # If we cannot find the metadata (because of editable install for example), try to import directly.
Repository: ollama/ollama
Pull request: Update api.md

Changed the calculation of tps (token/s) in the documentation

Changed files:
filename: docs/api.md
patch: @@ -95,7 +95,7 @@ The final response in the stream also includes additional data about the generat
 - `context`: an encoding of the conversation used in this response, this can be sent in the next request to keep a conversational memory
 - `response`: empty if the response was streamed, if not streamed, this will contain the full response
 
-To calculate how fast the response is generated in tokens per second (token/s), divide `eval_count` / `eval_duration`.
+To calculate how fast the response is generated in tokens per second (token/s), divide `eval_count` / `eval_duration` * `10^9`.
 
 ```json
 {
Repository: facebook/react
Pull request: [Flight] Ship DEV-only enableServerComponentLogs flag in Stable/Canary

To recap. This only affects DEV and RSC. It patches console on the server in DEV (similar to how React DevTools already does and what we did for the double logging). Then replays those logs with a `[Server]` badge on the client so you don't need a server terminal open.

This has been on for over 6 months now in our experimental channel and we've had a lot of coverage in Next.js due to various experimental flags like taint and ppr.

It's non-invasive in that even if something throws we just serialize that as an unknown value.

The main feedback we've gotten was:

- The serialization depth wasn't deep enough which I addressed in #30294 and haven't really had any issues since. This could still be an issue or the inverse that you serialize too many logs that are also too deep. This is not so much an issue with intentional logging and things like accidental errors don't typically have unbounded arguments (e.g. React errors are always string arguments). The ideal would be some way to retain objects and then load them on-demand but that needs more plumbing. Which can be later.
- The other was that double logging on the server is annoying if the same terminal does both the RSC render and SSR render which was addressed in #30207. It is now off by default in node/edge-builds of the client, on by default in browser builds. With the `replayConsole` option to either opt-in or out.

We've reached a good spot now I think.

These are better with `enableOwnerStacks` but that's a separate track and not needed.

The only thing to document here, other than maybe that we're doing it, is the `replayConsole` option but that's part of the RSC renderers that themselves are not documented so nowhere to document it.

Changed files:
filename: packages/shared/ReactFeatureFlags.js
patch: @@ -134,7 +134,7 @@ export const alwaysThrottleRetries = true;
 
 export const passChildrenWhenCloningPersistedNodes = false;
 
-export const enableServerComponentLogs = __EXPERIMENTAL__;
+export const enableServerComponentLogs = true;
 
 /**
  * Enables a new Fiber flag used in persisted mode to reduce the number
Repository: huggingface/transformers
Pull request: Fix dtype casting with quantization

# What does this PR do?

We should always trust the dtype of the params in the meta model, except when the parameter is going to be quantized!
Got broken in https://github.com/huggingface/transformers/pull/41548, where we stopped looking at the `keep_in_fp_32_regex`, to instead trust the model dtypes directly!

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -557,7 +557,7 @@ def _infer_parameter_dtype(
     is_param_float8_e4m3fn = is_torch_e4m3fn_available and empty_param.dtype == torch.float8_e4m3fn
     if empty_param.dtype.is_floating_point and not is_param_float8_e4m3fn:
         # dtype that was instantiated in the meta model -- note that this respects subconfigs dtypes
-        if hf_quantizer is not None:
+        if hf_quantizer is not None and hf_quantizer.param_needs_quantization(model, param_name):
             casting_dtype = model.config._pre_quantization_dtype
         else:
             casting_dtype = old_param.dtype
Repository: ollama/ollama
Pull request: Support Fedoras standard ROCm location

Fixes #3877 

Changed files:
filename: gpu/amd_common.go
patch: @@ -81,8 +81,10 @@ func commonAMDValidateLibDir() (string, error) {
 	}
 
 	// Well known location(s)
-	if rocmLibUsable(RocmStandardLocation) {
-		return RocmStandardLocation, nil
+	for _, path := range RocmStandardLocations {
+		if rocmLibUsable(path) {
+			return path, nil
+		}
 	}
 
 	// Installer payload location if we're running the installed binary

filename: gpu/amd_linux.go
patch: @@ -25,12 +25,12 @@ const (
 	// Prefix with the node dir
 	GPUTotalMemoryFileGlob = "mem_banks/*/properties" // size_in_bytes line
 	GPUUsedMemoryFileGlob  = "mem_banks/*/used_memory"
-	RocmStandardLocation   = "/opt/rocm/lib"
 )
 
 var (
 	// Used to validate if the given ROCm lib is usable
-	ROCmLibGlobs = []string{"libhipblas.so.2*", "rocblas"} // TODO - probably include more coverage of files here...
+	ROCmLibGlobs          = []string{"libhipblas.so.2*", "rocblas"} // TODO - probably include more coverage of files here...
+	RocmStandardLocations = []string{"/opt/rocm/lib", "/usr/lib64"}
 )
 
 // Gather GPU information from the amdgpu driver if any supported GPUs are detected

filename: gpu/amd_windows.go
patch: @@ -14,15 +14,15 @@ import (
 )
 
 const (
-	RocmStandardLocation = "C:\\Program Files\\AMD\\ROCm\\5.7\\bin" // TODO glob?
 
 	// TODO  We're lookinng for this exact name to detect iGPUs since hipGetDeviceProperties never reports integrated==true
 	iGPUName = "AMD Radeon(TM) Graphics"
 )
 
 var (
 	// Used to validate if the given ROCm lib is usable
-	ROCmLibGlobs = []string{"hipblas.dll", "rocblas"} // TODO - probably include more coverage of files here...
+	ROCmLibGlobs          = []string{"hipblas.dll", "rocblas"}                 // TODO - probably include more coverage of files here...
+	RocmStandardLocations = []string{"C:\\Program Files\\AMD\\ROCm\\5.7\\bin"} // TODO glob?
 )
 
 func AMDGetGPUInfo() []GpuInfo {

filename: scripts/install.sh
patch: @@ -166,8 +166,8 @@ fi
 
 if check_gpu lspci amdgpu || check_gpu lshw amdgpu; then
     # Look for pre-existing ROCm v6 before downloading the dependencies
-    for search in "${HIP_PATH:-''}" "${ROCM_PATH:-''}" "/opt/rocm"; do
-        if [ -n "${search}" ] && [ -e "${search}/lib/libhipblas.so.2" ]; then
+    for search in "${HIP_PATH:-''}" "${ROCM_PATH:-''}" "/opt/rocm" "/usr/lib64"; do
+        if [ -n "${search}" ] && [ -e "${search}/libhipblas.so.2" -o -e "${search}/lib/libhipblas.so.2" ]; then
             status "Compatible AMD GPU ROCm library detected at ${search}"
             install_success
             exit 0
Repository: ggml-org/llama.cpp
Pull request: move copilot instructions to AGENTS.md

Also included more instructions about AI usage disclosure as some contributors don't read `CONTRIBUTION.md`

Tighter guidelines like https://github.com/processing/p5.js/blob/main/AGENTS.md can be more desirable, but idk why it doesn't work on claude code or copilot. The AI still make changes (even dangerous and stupid changes, like changes that violate thread safety) when I asked - they definitely never say "no" to users.


Changed files:
filename: AGENTS.md
patch: @@ -1,4 +1,4 @@
-# Copilot Instructions for llama.cpp
+# Instructions for llama.cpp
 
 ## Repository Overview
 
@@ -12,6 +12,24 @@ llama.cpp is a large-scale C/C++ project for efficient LLM (Large Language Model
 - **Backends supported**: CPU (AVX/NEON/RVV optimized), CUDA, Metal, Vulkan, SYCL, ROCm, MUSA
 - **License**: MIT
 
+## Disclose AI Usage
+
+It is crucial to remind contributors that the project mandates disclosure of any AI usage in pull requests. This requirement stems from the potential for AI-generated code to include suboptimal optimizations and hidden bugs, owing to the inherent overconfidence in AI outputs.
+
+When generating significant portions of code, address this by:
+- Informing the user that AI-generated content may be rejected by maintainers.
+- Clearly marking AI-generated code in commit messages and comments.
+    - Example of commit message: `[AI] Fix a race condition in ...`
+    - Example of code comment: `// [AI] spawn a new thread ...`
+
+These measures apply to:
+- Changes resulting in large portions of code or complex logic.
+- Modifications or additions to public APIs in `llama.h`, `ggml.h`, or `mtmd.h`.
+- Backend-related changes, such as those involving CPU, CUDA, Metal, Vulkan, etc.
+- Modifications to `tools/server`.
+
+Note: These measures can be omitted for small fixes or trivial changes.
+
 ## Build Instructions
 
 ### Prerequisites
@@ -251,6 +269,7 @@ Primary tools:
 - **Cross-platform compatibility**: Test on Linux, macOS, Windows when possible
 - **Performance focus**: This is a performance-critical inference library
 - **API stability**: Changes to `include/llama.h` require careful consideration
+- **Disclose AI Usage**: Refer to the "Disclose AI Usage" earlier in this document
 
 ### Git Workflow
 - Always create feature branches from `master`
Repository: nodejs/node
Pull request: tools: skip test-internet workflow for draft PRs

When this was opened as draft: 
<img width="427" height="43" alt="CleanShot 2025-09-09 at 08 58 45" src="https://github.com/user-attachments/assets/3ea00a71-8b60-4d7d-ad9f-4c0750b5104e" />


Changed files:
filename: .github/workflows/test-internet.yml
patch: @@ -43,7 +43,7 @@ permissions:
 
 jobs:
   test-internet:
-    if: github.repository == 'nodejs/node' || github.event_name != 'schedule'
+    if: github.event_name == 'schedule' && github.repository == 'nodejs/node' || github.event.pull_request.draft == false
     runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8  # v5.0.0
Repository: ollama/ollama
Pull request: Fix stale test logic

The model processing was recently changed to be deferred but this test scenario hadn't been adjusted for that change in behavior.

Changed files:
filename: server/sched_test.go
patch: @@ -352,11 +352,9 @@ func TestGetRunner(t *testing.T) {
 	scenario1c.req.model.ModelPath = "bad path"
 	slog.Info("scenario1c")
 	successCh1c, errCh1c := s.GetRunner(scenario1c.ctx, scenario1c.req.model, scenario1c.req.opts, scenario1c.req.sessionDuration)
-	require.Len(t, s.pendingReqCh, 0)
-	require.Len(t, successCh1c, 0)
-	require.Len(t, errCh1c, 0)
-
+	// Starts in pending channel, then should be quickly processsed to return an error
 	time.Sleep(5 * time.Millisecond)
+	require.Len(t, successCh1c, 0)
 	s.loadedMu.Lock()
 	require.Len(t, s.loaded, 0)
 	s.loadedMu.Unlock()
Repository: vercel/next.js
Pull request: fix: release next-rspack ci

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to understand the PR)
- When linking to a Slack thread, you might want to share details of the conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

should use `secrets.NPM_TOKEN_ELEVATED` to `env.NPM_TOKEN`


Changed files:
filename: .github/workflows/release-next-rspack.yml
patch: @@ -118,7 +118,7 @@ jobs:
         run: |
           echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
         env:
-          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+          NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
 
       - name: Release npm binding packages
         run: |