helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: turbo-tasks-backend: assert non-transient task_ids in track_modification

### What?

Add a `debug_assert!` in `StorageWriteGuard::track_modification` to enforce that transient `TaskId`s are never inserted into the persistence-modified set.

### Why?

Concurrent server component HMR updates triggered a runtime panic in Turbopack:

```
internal error: entered unreachable code: transient task_ids should never be enqueued to be persisted
```

This `unreachable!` lives in `snapshot_and_persist` (`backend/mod.rs:1254`), which is called during the persist cycle. It fires when a transient `TaskId` is found in `Storage::modified` — the set that tracks tasks whose state needs to be written to disk.

**Transient task IDs (high bit set) are never serialized.** The invariant was enforced only at the *caller layer*:

- `TaskGuardImpl::track_modification` (`operation/mod.rs:1029`) guards with `if !self.task_id.is_transient()`
- `TaskGuardImpl::invalidate_serialization` (`operation/mod.rs:970`) guards with `if !self.task_id.is_transient()`

But `StorageWriteGuard::track_modification` — the public method on the storage struct itself — had no such guard. Under concurrent HMR invalidations, a transient task ID could reach this method via a code path that bypasses the caller-level checks, inserting the ID into `Storage::modified` and causing the panic downstream during the next persist cycle.

The flaky test is `test/development/app-dir/hmr-iframe/hmr-iframe.test.ts` — it triggers two simultaneous server component file changes (one in an iframe, one in the parent), which races the persist cycle against concurrent invalidations.

### How?

Add a `debug_assert!` in `StorageWriteGuard::track_modification` (the sole public entry point into the storage mutation path) that matches the invariant already checked at the caller layer:

```rust
debug_assert!(
    !self.inner.key().is_transient(),
    "transient task_ids should never be enqueued to be persisted"
);
```

This enforces the invariant at the storage boundary in debug builds, surfacing the violation at the point of insertion rather than much later during the persist cycle. The message deliberately matches the existing `unreachable!` downstream so both failure modes are easy to correlate.

**Verification:**
- `cargo test -p turbo-tasks-backend` — all unit tests pass
- `pnpm build-all` — build succeeds
- `NEXT_SKIP_ISOLATE=1 NEXT_TEST_MODE=dev pnpm testheadless test/development/app-dir/hmr-iframe/hmr-iframe.test.ts` — 3/3 consecutive passes (was flaky before)

Changed files:
filename: turbopack/crates/turbo-tasks-backend/src/backend/storage.rs
patch: @@ -302,6 +302,10 @@ impl StorageWriteGuard<'_> {
         category: SpecificTaskDataCategory,
         #[allow(unused_variables)] name: &str,
     ) {
+        debug_assert!(
+            !self.inner.key().is_transient(),
+            "transient task_ids should never be enqueued to be persisted"
+        );
         self.track_modification_internal(
             category,
             #[cfg(feature = "trace_task_modification")]
Repository: ollama/ollama
Pull request: Fix cmake install command in README

Update installation command for MLX component in README.

Changed files:
filename: x/README.md
patch: @@ -9,7 +9,7 @@ Support is currently limited to MacOS and Linux with CUDA GPUs.  We're looking t
 ```
 cmake --preset MLX
 cmake --build --preset MLX --parallel
-cmake --install --component MLX
+cmake --install build --component MLX
 go build -tags mlx .
 ```
Repository: huggingface/transformers
Pull request: Another (small) set of fixes required for tiny model creation

# What does this PR do?

- 2 model tester classes didn't follow the usual way we do things, which cause the tiny model creation script to fail with those model classes.
  - (the script initializes instances of model testers, in order to call methods like `get_config`) 

- Add a `get_config` for `Gemma3nAudioModelTester`: the script tries to get the config via the model tester classes: it checks some usual tester methods, but not `get_audio_encoder_config`.

Changed files:
filename: tests/models/gemma3n/test_modeling_gemma3n.py
patch: @@ -109,6 +109,9 @@ def get_audio_encoder_config(self):
             conf_attention_context_left=5,
         )
 
+    def get_config(self):
+        return self.get_audio_encoder_config()
+
     def prepare_config_and_inputs_for_common(self):
         # Prepare inputs for the audio encoder
         feature_extractor_config = self.get_feature_extractor_config()

filename: tests/models/patchtsmixer/test_modeling_patchtsmixer.py
patch: @@ -63,6 +63,7 @@
 class PatchTSMixerModelTester:
     def __init__(
         self,
+        parent,
         context_length: int = 32,
         patch_length: int = 8,
         num_input_channels: int = 3,
@@ -103,6 +104,7 @@ def __init__(
         seed_number=42,
         num_parallel_samples=4,
     ):
+        self.parent = parent
         self.num_input_channels = num_input_channels
         self.context_length = context_length
         self.patch_length = patch_length
@@ -227,7 +229,7 @@ class PatchTSMixerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.Test
     has_attentions = False
 
     def setUp(self):
-        self.model_tester = PatchTSMixerModelTester()
+        self.model_tester = PatchTSMixerModelTester(self)
         self.config_tester = ConfigTester(
             self,
             config_class=PatchTSMixerConfig,

filename: tests/models/pp_ocrv5_server_det/test_modeling_pp_ocrv5_server_det.py
patch: @@ -51,8 +51,17 @@
 
 class PPOCRV5ServerDetModelTester:
     def __init__(
-        self, batch_size=3, image_size=128, num_channels=3, num_stages=5, is_training=False, scale=1.0, divisor=16
+        self,
+        parent,
+        batch_size=3,
+        image_size=128,
+        num_channels=3,
+        num_stages=5,
+        is_training=False,
+        scale=1.0,
+        divisor=16,
     ):
+        self.parent = parent
         self.batch_size = batch_size
         self.num_channels = num_channels
         self.image_size = image_size
@@ -142,6 +151,7 @@ class PPOCRV5ServerDetModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.
 
     def setUp(self):
         self.model_tester = PPOCRV5ServerDetModelTester(
+            self,
             batch_size=3,
             is_training=False,
             image_size=128,
Repository: facebook/react
Pull request: [compiler][snap] Fix for filter mode with nested files, 'error.' prefix


Fixes some issues i ran into w my recent snap changes:
* Correctly match against patterns that contain subdirectories, eg `fbt/fbt-call`
* When checking if the input pattern has an extension, only prune known supported extensions. Our convention of `error.<name>` for fixtures that error makes the rest of the test name look like an extension to `path.extname()`.

Tested with lots of different patterns including `error.` examples at the top level and in nested directories, etc.


Changed files:
filename: compiler/packages/snap/src/fixture-utils.ts
patch: @@ -44,21 +44,6 @@ function stripExtension(filename: string, extensions: Array<string>): string {
   return filename;
 }
 
-/**
- * Strip all extensions from a filename
- * e.g., "foo.expect.md" -> "foo"
- */
-function stripAllExtensions(filename: string): string {
-  let result = filename;
-  while (true) {
-    const extension = path.extname(result);
-    if (extension === '') {
-      return result;
-    }
-    result = path.basename(result, extension);
-  }
-}
-
 export async function readTestFilter(): Promise<TestFilter | null> {
   if (!(await exists(FILTER_PATH))) {
     throw new Error(`testfilter file not found at \`${FILTER_PATH}\``);
@@ -134,13 +119,15 @@ async function readInputFixtures(
           // `alias-while` => search for `alias-while{.js,.jsx,.ts,.tsx}`
           // `alias-while.js` => search as-is
           // `alias-while.expect.md` => search for `alias-while{.js,.jsx,.ts,.tsx}`
-          const basename = path.basename(pattern);
-          const basenameWithoutExt = stripAllExtensions(basename);
-          const hasExtension = basename !== basenameWithoutExt;
+          const patternWithoutExt = stripExtension(pattern, [
+            ...INPUT_EXTENSIONS,
+            SNAPSHOT_EXTENSION,
+          ]);
+          const hasExtension = pattern !== patternWithoutExt;
           const globPattern =
             hasExtension && !pattern.endsWith(SNAPSHOT_EXTENSION)
               ? pattern
-              : `${basenameWithoutExt}{${INPUT_EXTENSIONS.join(',')}}`;
+              : `${patternWithoutExt}{${INPUT_EXTENSIONS.join(',')}}`;
           return glob.glob(globPattern, {
             cwd: rootDir,
           });
@@ -181,7 +168,10 @@ async function readOutputFixtures(
       await Promise.all(
         filter.paths.map(pattern => {
           // Strip all extensions and find matching .expect.md files
-          const basenameWithoutExt = stripAllExtensions(pattern);
+          const basenameWithoutExt = stripExtension(pattern, [
+            ...INPUT_EXTENSIONS,
+            SNAPSHOT_EXTENSION,
+          ]);
           return glob.glob(`${basenameWithoutExt}${SNAPSHOT_EXTENSION}`, {
             cwd: rootDir,
           });
Repository: vercel/next.js
Pull request: Tracing: tag spans as failed if their runner fn fails

This adds a dedicated attribute, `failed`, to a span representing if the procedure failed. It's then set if the runner function threw.

Test Plan: Added an e2e test


Changed files:
filename: packages/next/src/trace/trace.ts
patch: @@ -133,6 +133,9 @@ export class Span {
   traceFn<T>(fn: (span: Span) => T): T {
     try {
       return fn(this)
+    } catch (e) {
+      this.attrs['failed'] = true
+      throw e
     } finally {
       this.stop()
     }
@@ -141,6 +144,9 @@ export class Span {
   async traceAsyncFn<T>(fn: (span: Span) => T | Promise<T>): Promise<T> {
     try {
       return await fn(this)
+    } catch (e) {
+      this.attrs['failed'] = true
+      throw e
     } finally {
       this.stop()
     }

filename: test/production/build-failed-trace/build-failed-trace.test.ts
patch: @@ -0,0 +1,37 @@
+import { nextTestSetup, isNextStart } from 'e2e-utils'
+import { join } from 'path'
+import { readFileSync } from 'fs'
+import type { TraceEvent } from 'next/dist/trace'
+
+function parseTraceFile(tracePath: string): TraceEvent[] {
+  const content = readFileSync(tracePath, 'utf8')
+  const events: TraceEvent[] = []
+  for (const line of content.trim().split('\n').filter(Boolean)) {
+    events.push(...(JSON.parse(line) as TraceEvent[]))
+  }
+  return events
+}
+
+describe('build-failed-trace', () => {
+  if (!isNextStart) {
+    return
+  }
+
+  const { next } = nextTestSetup({
+    files: __dirname,
+    skipStart: true,
+    skipDeployment: true,
+  })
+
+  it('should mark the next-build span as failed when the build fails', async () => {
+    const { exitCode } = await next.build()
+    expect(exitCode).not.toBe(0)
+
+    const tracePath = join(next.testDir, '.next', 'trace')
+    const events = parseTraceFile(tracePath)
+
+    const nextBuildEvent = events.find((e) => e.name === 'next-build')
+    expect(nextBuildEvent).toBeDefined()
+    expect(nextBuildEvent!.tags).toMatchObject({ failed: true })
+  })
+})

filename: test/production/build-failed-trace/next.config.js
patch: @@ -0,0 +1,5 @@
+module.exports = {
+  redirects: async () => {
+    throw new Error('intentional build failure for trace testing')
+  },
+}

filename: test/production/build-failed-trace/pages/index.tsx
patch: @@ -0,0 +1,3 @@
+export default function Page() {
+  return <p>hello world</p>
+}
Repository: ollama/ollama
Pull request: Fix Ollama Troubleshooting Page


The file  
[`docs/troubleshooting.md`](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md)  
links to the Ollama troubleshooting webpage, but that webpage renders the same file, resulting in a circular reference.

As a result,  
[`docs/troubleshooting.mdx`](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.mdx)  
never takes priority and is not displayed as intended.

This PR proposes removing  
[`docs/troubleshooting.md`](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md)  
so that the documentation system correctly falls back to  
[`docs/troubleshooting.mdx`](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.mdx),  
eliminating duplication and ensuring the correct content is rendered.

Changed files:
filename: .github/ISSUE_TEMPLATE/10_bug_report.yml
patch: @@ -13,7 +13,7 @@ body:
     id: logs
     attributes:
       label: Relevant log output
-      description: Please copy and paste any relevant log output. See [Troubleshooting Guide](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) for details.
+      description: Please copy and paste any relevant log output. See [Troubleshooting Guide](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.mdx#how-to-troubleshoot-issues) for details.
       render: shell
     validations:
       required: false

filename: docs/troubleshooting.md
patch: @@ -1,3 +0,0 @@
-# Troubleshooting
-
-For troubleshooting, see [https://docs.ollama.com/troubleshooting](https://docs.ollama.com/troubleshooting)
Repository: nodejs/node
Pull request: worker: heap profile optimizations

This PR makes two small optimizations to worker heap profile serialization:

 - Stop the sampling heap profiler immediately after `GetAllocationProfile()` instead of after JSON serialization completes.
 - Serialize heap profiles without extra indentation and newlines.

Changed files:
filename: src/node_worker.cc
patch: @@ -1121,7 +1121,8 @@ static bool serializeProfile(Isolate* isolate, std::ostringstream& out_stream) {
   if (!profile) {
     return false;
   }
-  JSONWriter writer(out_stream, false);
+  profiler->StopSamplingHeapProfiler();
+  JSONWriter writer(out_stream, true);
   writer.json_start();
 
   writer.json_arraystart("samples");
@@ -1139,7 +1140,6 @@ static bool serializeProfile(Isolate* isolate, std::ostringstream& out_stream) {
   writer.json_objectend();
 
   writer.json_end();
-  profiler->StopSamplingHeapProfiler();
   return true;
 }
Repository: huggingface/transformers
Pull request: Fix CookieCutter

# What does this PR do?

I had some issues with running `transformers-cli add-new-model-like`. This PR fixes it.

Fixes #44661.


Changed files:
filename: src/transformers/cli/add_new_model_like.py
patch: @@ -142,6 +142,7 @@ def __init__(self, lowercase_name: str):
 
         # Get tokenizer class
         if self.lowercase_name in TOKENIZER_MAPPING_NAMES:
+            self.tokenizer_class = None
             self.fast_tokenizer_class = TOKENIZER_MAPPING_NAMES[self.lowercase_name]
             self.fast_tokenizer_class = (
                 None if self.fast_tokenizer_class == "PreTrainedTokenizerFast" else self.fast_tokenizer_class
Repository: ollama/ollama
Pull request: dockerfile: remove unused COPY command


Changed files:
filename: Dockerfile
patch: @@ -182,7 +182,6 @@ COPY --from=cuda-12 dist/lib/ollama /lib/ollama/
 COPY --from=cuda-13 dist/lib/ollama /lib/ollama/
 COPY --from=vulkan  dist/lib/ollama  /lib/ollama/
 COPY --from=mlx     /go/src/github.com/ollama/ollama/dist/lib/ollama /lib/ollama/
-COPY --from=mlx     /go/src/github.com/ollama/ollama/dist/bin/ /bin/
 
 FROM --platform=linux/arm64 scratch AS arm64
 # COPY --from=cuda-11 dist/lib/ollama/ /lib/ollama/
Repository: golang/go
Pull request: net/url: strip relative path components for JoinPath

Fixes #54385 

Changed files:
filename: src/encoding/json/bench_test.go
patch: @@ -18,6 +18,7 @@ import (
 	"io"
 	"os"
 	"reflect"
+	"regexp"
 	"runtime"
 	"strings"
 	"sync"
@@ -508,3 +509,33 @@ func BenchmarkEncodeMarshaler(b *testing.B) {
 		}
 	})
 }
+
+func BenchmarkEncoderEncode(b *testing.B) {
+	b.ReportAllocs()
+	type T struct {
+		X, Y string
+	}
+	v := &T{"foo", "bar"}
+	b.RunParallel(func(pb *testing.PB) {
+		for pb.Next() {
+			if err := NewEncoder(io.Discard).Encode(v); err != nil {
+				b.Fatal(err)
+			}
+		}
+	})
+}
+
+func BenchmarkNumberIsValid(b *testing.B) {
+	s := "-61657.61667E+61673"
+	for i := 0; i < b.N; i++ {
+		isValidNumber(s)
+	}
+}
+
+func BenchmarkNumberIsValidRegexp(b *testing.B) {
+	var jsonNumberRegexp = regexp.MustCompile(`^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$`)
+	s := "-61657.61667E+61673"
+	for i := 0; i < b.N; i++ {
+		jsonNumberRegexp.MatchString(s)
+	}
+}

filename: src/encoding/json/number_test.go
patch: @@ -116,18 +116,3 @@ func TestNumberIsValid(t *testing.T) {
 		}
 	}
 }
-
-func BenchmarkNumberIsValid(b *testing.B) {
-	s := "-61657.61667E+61673"
-	for i := 0; i < b.N; i++ {
-		isValidNumber(s)
-	}
-}
-
-func BenchmarkNumberIsValidRegexp(b *testing.B) {
-	var jsonNumberRegexp = regexp.MustCompile(`^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$`)
-	s := "-61657.61667E+61673"
-	for i := 0; i < b.N; i++ {
-		jsonNumberRegexp.MatchString(s)
-	}
-}

filename: src/encoding/json/stream_test.go
patch: @@ -347,21 +347,6 @@ func TestBlocking(t *testing.T) {
 	}
 }
 
-func BenchmarkEncoderEncode(b *testing.B) {
-	b.ReportAllocs()
-	type T struct {
-		X, Y string
-	}
-	v := &T{"foo", "bar"}
-	b.RunParallel(func(pb *testing.PB) {
-		for pb.Next() {
-			if err := NewEncoder(io.Discard).Encode(v); err != nil {
-				b.Fatal(err)
-			}
-		}
-	})
-}
-
 type tokenStreamCase struct {
 	json      string
 	expTokens []any
Repository: ollama/ollama
Pull request: docker: add missing deps

The new MLX library has extra dependencies.

Verification using a temporary image I pushed with this change:
```
% docker run --rm -it --runtime=nvidia --gpus all -e LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/lib/ollama/mlx_cuda_v13/  --entrypoint /bin/imagegen dhiltgen/ollama:0.14.0-rc0-0-g33ee716-dirty --help
Usage of /bin/imagegen:
  -cfg-scale float
    	CFG scale for image editing (default 4)
  -cpuprofile string
    	Write CPU profile to file
  -gpu-capture string
    	Capture GPU trace to .gputrace file (run with MTL_CAPTURE_ENABLED=1)
  -height int
    	Image height (default 1024)
  -image string
    	Image path for multimodal models
  -input-image value
    	Input image for image editing (can be specified multiple times)
  -layer-cache
    	Enable layer caching for faster diffusion (Z-Image, Qwen-Image). Not compatible with CFG/negative prompts.
  -list
    	List tensors only
  -max-tokens int
    	Max tokens (default 100)
  -model string
    	Model directory
  -negative-prompt string
    	Negative prompt for CFG (empty = no CFG, matching Python)
  -output string
    	Output path (default "output.png")
  -prompt string
    	Prompt (default "Hello")
  -qwen-image
    	Qwen-Image text-to-image generation
  -qwen-image-edit
    	Qwen-Image-Edit image editing
  -seed int
    	Random seed (default 42)
  -steps int
    	Denoising steps (default 9)
  -temperature float
    	Temperature (default 0.7)
  -top-k int
    	Top-k sampling (default 40)
  -top-p float
    	Top-p sampling (default 0.9)
  -width int
    	Image width (default 1024)
  -wired-limit int
    	Metal wired memory limit in GB (default 32)
  -zimage
    	Z-Image generation
```

Changed files:
filename: Dockerfile
patch: @@ -205,7 +205,7 @@ COPY --from=build /bin/ollama /bin/ollama
 
 FROM ubuntu:24.04
 RUN apt-get update \
-    && apt-get install -y ca-certificates libvulkan1 \
+    && apt-get install -y ca-certificates libvulkan1 libopenblas0 \
     && apt-get clean \
     && rm -rf /var/lib/apt/lists/*
 COPY --from=archive /bin /usr/bin
Repository: electron/electron
Pull request: fix: correct utility process exit code on Windows

Backport of #50256

See that PR for details.


Notes: Fixed utilityProcess exit event reporting incorrect exit codes on Windows when the exit code has the high bit


Changed files:
filename: shell/browser/api/electron_api_utility_process.cc
patch: @@ -258,7 +258,7 @@ void UtilityProcessWrapper::OnServiceProcessLaunch(
   EmitWithoutEvent("spawn");
 }
 
-void UtilityProcessWrapper::HandleTermination(uint64_t exit_code) {
+void UtilityProcessWrapper::HandleTermination(uint32_t exit_code) {
   // HandleTermination is called from multiple callsites,
   // we need to ensure we only process it for the first callsite.
   if (terminated_)
@@ -326,7 +326,7 @@ void UtilityProcessWrapper::CloseConnectorPort() {
   }
 }
 
-void UtilityProcessWrapper::Shutdown(uint64_t exit_code) {
+void UtilityProcessWrapper::Shutdown(uint32_t exit_code) {
   node_service_remote_.reset();
   HandleTermination(exit_code);
 }

filename: shell/browser/api/electron_api_utility_process.h
patch: @@ -57,7 +57,7 @@ class UtilityProcessWrapper final
   static gin_helper::Handle<UtilityProcessWrapper> Create(gin::Arguments* args);
   static raw_ptr<UtilityProcessWrapper> FromProcessId(base::ProcessId pid);
 
-  void Shutdown(uint64_t exit_code);
+  void Shutdown(uint32_t exit_code);
 
   // gin_helper::Wrappable
   static gin::DeprecatedWrapperInfo kWrapperInfo;
@@ -77,7 +77,7 @@ class UtilityProcessWrapper final
   void OnServiceProcessLaunch(const base::Process& process);
   void CloseConnectorPort();
 
-  void HandleTermination(uint64_t exit_code);
+  void HandleTermination(uint32_t exit_code);
 
   void PostMessage(gin::Arguments* args);
   bool Kill();

filename: spec/api-utility-process-spec.ts
patch: @@ -129,6 +129,22 @@ describe('utilityProcess module', () => {
       expect(code).to.equal(exitCode);
     });
 
+    ifit(process.platform === 'win32')('emits correct exit code when high bit is set on Windows', async () => {
+      // NTSTATUS code with high bit set should not be mangled by sign extension.
+      const exitCode = 0xC0000005;
+      const child = utilityProcess.fork(path.join(fixturesPath, 'custom-exit.js'), [`--exitCode=${exitCode}`]);
+      const [code] = await once(child, 'exit');
+      expect(code).to.equal(exitCode);
+    });
+
+    ifit(process.platform !== 'win32')('emits correct exit code when child process crashes on posix', async () => {
+      // Crash exit codes should not be sign-extended to large 64-bit values.
+      const child = utilityProcess.fork(path.join(fixturesPath, 'crash.js'));
+      const [code] = await once(child, 'exit');
+      expect(code).to.not.equal(0);
+      expect(code).to.be.lessThanOrEqual(0xFFFFFFFF);
+    });
+
     it('does not run JS after process.exit is called', async () => {
       const file = path.join(os.tmpdir(), `no-js-after-exit-log-${Math.random()}`);
       const child = utilityProcess.fork(path.join(fixturesPath, 'no-js-after-exit.js'), [`--testPath=${file}`]);