helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: [ci] Allow dry run


Allow running the compiler release script as dry run.


Changed files:
filename: .github/workflows/compiler_prereleases.yml
patch: @@ -19,6 +19,9 @@ on:
       tag_version:
         required: false
         type: string
+      dry_run:
+        required: false
+        type: boolean
     secrets:
       NPM_TOKEN:
         required: true
@@ -55,7 +58,13 @@ jobs:
           key: compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/yarn.lock') }}
       - run: yarn install --frozen-lockfile
         if: steps.node_modules.outputs.cache-hit != 'true'
-      - name: Publish packages to npm
+      - if: inputs.dry_run == true
+        name: Publish packages to npm (dry run)
+        run: |
+          cp ./scripts/release/ci-npmrc ~/.npmrc
+          scripts/release/publish.js --ci --versionName=${{ inputs.version_name }} --tag=${{ inputs.dist_tag }} ${{ inputs.tag_version && format('--tagVersion={0}', inputs.tag_version) || '' }}
+      - if: inputs.dry_run != true
+        name: Publish packages to npm
         run: |
           cp ./scripts/release/ci-npmrc ~/.npmrc
           scripts/release/publish.js --frfr --ci --versionName=${{ inputs.version_name }} --tag=${{ inputs.dist_tag }} ${{ inputs.tag_version && format('--tagVersion={0}', inputs.tag_version) || '' }}

filename: .github/workflows/compiler_prereleases_manual.yml
patch: @@ -17,6 +17,9 @@ on:
       tag_version:
         required: false
         type: string
+      dry_run:
+        required: false
+        type: boolean
 
 permissions: {}
 
@@ -33,5 +36,6 @@ jobs:
       dist_tag: ${{ inputs.dist_tag }}
       version_name: ${{ inputs.version_name }}
       tag_version: ${{ inputs.tag_version }}
+      dry_run: ${{ inputs.dry_run }}
     secrets:
       NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

filename: .github/workflows/compiler_prereleases_nightly.yml
patch: @@ -19,5 +19,6 @@ jobs:
       release_channel: experimental
       dist_tag: experimental
       version_name: '0.0.0'
+      dry_run: false
     secrets:
       NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Repository: ollama/ollama
Pull request: fix: conv2d bias


Changed files:
filename: ml/nn/convolution.go
patch: @@ -10,7 +10,8 @@ type Conv2D struct {
 func (m *Conv2D) Forward(ctx ml.Context, t ml.Tensor, s0, s1, p0, p1, d0, d1 int) ml.Tensor {
 	t = m.Weight.Conv2D(ctx, t, s0, s1, p0, p1, d0, d1)
 	if m.Bias != nil {
-		t = t.Add(ctx, m.Bias)
+		// Bias shape is (out_channels,) while t shape is (width, height, out_channels, batch)
+		t = t.Add(ctx, m.Bias.Reshape(ctx, 1, 1, -1))
 	}
 	return t
 }
Repository: facebook/react
Pull request: [compiler] Fix incorrect version name


Script was using the wrong version name.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34764).
* #34765
* __->__ #34764

Changed files:
filename: compiler/scripts/release/publish.js
patch: @@ -145,10 +145,15 @@ async function main() {
       files: {exclude: ['.DS_Store']},
     });
     const truncatedHash = hash.slice(0, 7);
-    let newVersion =
-      argv.tagVersion == null || argv.tagVersion === ''
-        ? `${argv.versionName}-${argv.tag}`
-        : `${argv.versionName}-${argv.tag}.${argv.tagVersion}`;
+    let newVersion;
+    if (argv.tag === 'latest') {
+      newVersion = argv.versionName;
+    } else {
+      newVersion =
+        argv.tagVersion == null || argv.tagVersion === ''
+          ? `${argv.versionName}-${argv.tag}`
+          : `${argv.versionName}-${argv.tag}.${argv.tagVersion}`;
+    }
     if (argv.tag === 'experimental' || argv.tag === 'beta') {
       newVersion = `${newVersion}-${truncatedHash}-${dateString}`;
     }
Repository: vercel/next.js
Pull request: [test] Fix error code snapshots when testing with React 18

Follow-up to https://github.com/vercel/next.js/pull/90497
Thought about rspack but forgot about React 18

---
[Slack Thread](https://vercel.slack.com/archives/C04KC8A53T7/p1772114207624659?thread_ts=1772114207.624659&cid=C04KC8A53T7)

<p><a href="https://cursor.com/agents/bc-4a3f545f-2a51-53eb-a612-95eabbd901b1"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-4a3f545f-2a51-53eb-a612-95eabbd901b1"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</p>



Changed files:
filename: test/development/acceptance/ReactRefreshLogBox.test.ts
patch: @@ -118,6 +118,7 @@ describe('ReactRefreshLogBox', () => {
       if (isTurbopack) {
         await expect(browser).toDisplayRedbox(`
          {
+           "code": "E394",
            "description": "no",
            "environmentLabel": null,
            "label": "Runtime Error",
@@ -135,6 +136,7 @@ describe('ReactRefreshLogBox', () => {
       } else {
         await expect(browser).toDisplayRedbox(`
          {
+           "code": "E394",
            "description": "no",
            "environmentLabel": null,
            "label": "Runtime Error",
@@ -1099,6 +1101,7 @@ describe('ReactRefreshLogBox', () => {
     if (isReact18) {
       await expect(browser).toDisplayRedbox(`
        {
+         "code": "E394",
          "description": "{"a":1,"b":"x"}",
          "environmentLabel": null,
          "label": "Runtime Error",
@@ -1148,6 +1151,7 @@ describe('ReactRefreshLogBox', () => {
     if (isReact18) {
       await expect(browser).toDisplayRedbox(`
        {
+         "code": "E394",
          "description": "class Hello {
        }",
          "environmentLabel": null,
@@ -1197,6 +1201,7 @@ describe('ReactRefreshLogBox', () => {
     if (isReact18) {
       await expect(browser).toDisplayRedbox(`
        {
+         "code": "E394",
          "description": "string error",
          "environmentLabel": null,
          "label": "Runtime Error",
@@ -1244,6 +1249,7 @@ describe('ReactRefreshLogBox', () => {
     if (isReact18) {
       await expect(browser).toDisplayRedbox(`
        {
+         "code": "E394",
          "description": "A null error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined",
          "environmentLabel": null,
          "label": "Runtime Error",
Repository: facebook/react
Pull request: [compiler] Update release script for latest tag


Updates our release script so we can publish to the `latest` tag.


Changed files:
filename: compiler/scripts/release/publish.js
patch: @@ -68,7 +68,7 @@ async function main() {
     .option('tag', {
       description: 'Tag to publish to npm',
       type: 'choices',
-      choices: ['experimental', 'beta', 'rc'],
+      choices: ['experimental', 'beta', 'rc', 'latest'],
       default: 'experimental',
     })
     .option('tag-version', {
@@ -181,21 +181,9 @@ async function main() {
       if (otp != null) {
         opts.push(`--otp=${otp}`);
       }
-      /**
-       * Typically, the `latest` tag is reserved for stable package versions. Since the the compiler
-       * is still pre-release, until we have a stable release let's only add the
-       * `latest` tag to non-experimental releases.
-       *
-       * `latest` is added by default, so we only override it for experimental releases so that
-       * those don't get the `latest` tag.
-       *
-       * TODO: Update this when we have a stable release.
-       */
-      if (argv.tag === 'experimental') {
-        opts.push('--tag=experimental');
-      } else {
-        opts.push('--tag=latest');
-      }
+
+      opts.push(`--tag=${argv.tag}`);
+
       try {
         await spawnHelper(
           'npm',
Repository: nodejs/node
Pull request: inspector: unwrap internal/debugger/inspect imports

Artifact left over from the inspector adoption.

Refs: #38161

Changed files:
filename: lib/internal/debugger/inspect.js
patch: @@ -32,11 +32,8 @@ const {
   AbortController,
 } = require('internal/abort_controller');
 
-const { 0: InspectClient, 1: createRepl } =
-    [
-      require('internal/debugger/inspect_client'),
-      require('internal/debugger/inspect_repl'),
-    ];
+const InspectClient = require('internal/debugger/inspect_client');
+const createRepl = require('internal/debugger/inspect_repl');
 
 const debuglog = util.debuglog('inspect');
Repository: nodejs/node
Pull request: test_runner: run afterEach for runtime t.skip()

Ensure afterEach runs when a test is skipped at runtime (t.skip()), while keeping static { skip: true } behavior unchanged.

Runtime t.skip() previously set skipped and prevented afterEach, even if beforeEach ran.
This left resources uncleaned and differed from user expectations.

Fixes: #61462 

Changed files:
filename: lib/internal/test_runner/test.js
patch: @@ -1152,13 +1152,15 @@ class Test extends AsyncResource {
       ctx.plan(this.expectedAssertions);
     }
 
+    const wasSkippedBeforeRun = this.skipped;
+
     const after = async () => {
       if (this.hooks.after.length > 0) {
         await this.runHook('after', hookArgs);
       }
     };
     const afterEach = runOnce(async () => {
-      if (this.parent?.hooks.afterEach.length > 0 && !this.skipped) {
+      if (this.parent?.hooks.afterEach.length > 0 && !wasSkippedBeforeRun) {
         await this.parent.runHook('afterEach', hookArgs);
       }
     }, kRunOnceOptions);

filename: test/parallel/test-runner-aftereach-runtime-skip.js
patch: @@ -0,0 +1,36 @@
+'use strict';
+
+const common = require('../common');
+const assert = require('node:assert');
+const { beforeEach, afterEach, test } = require('node:test');
+
+let beforeEachTotal = 0;
+let afterEachRuntimeSkip = 0;
+let afterEachTotal = 0;
+
+beforeEach(common.mustCall(() => {
+  beforeEachTotal++;
+}, 2));
+
+afterEach(common.mustCall((t) => {
+  afterEachTotal++;
+  if (t.name === 'runtime skip') {
+    afterEachRuntimeSkip++;
+  }
+}, 2));
+
+test('normal test', (t) => {
+  t.assert.ok(true);
+});
+
+test('runtime skip', (t) => {
+  t.skip('skip after setup');
+});
+
+test('static skip', { skip: true }, common.mustNotCall());
+
+process.on('exit', () => {
+  assert.strictEqual(beforeEachTotal, 2);
+  assert.strictEqual(afterEachRuntimeSkip, 1);
+  assert.strictEqual(afterEachTotal, 2);
+});
Repository: ollama/ollama
Pull request: embeddings: modified tests to validate exact base-64 string

**WHAT** 
Added expectBase64 field to embedding test cases 
Updated test data with expected base64 strings
Enhanced test validation to iterate through ALL embeddings and compare with expected value 

**WHY** 
To make embedding test more thorough / comprehensive 

Changed files:
filename: openai/openai_encoding_format_test.go
patch: @@ -10,19 +10,20 @@ import (
 
 func TestToEmbeddingList(t *testing.T) {
 	testCases := []struct {
-		name        string
-		embeddings  [][]float32
-		format      string
-		expectType  string // "float" or "base64"
-		expectCount int
-		promptEval  int
+		name         string
+		embeddings   [][]float32
+		format       string
+		expectType   string // "float" or "base64"
+		expectBase64 []string
+		expectCount  int
+		promptEval   int
 	}{
-		{"float format", [][]float32{{0.1, -0.2, 0.3}}, "float", "float", 1, 10},
-		{"base64 format", [][]float32{{0.1, -0.2, 0.3}}, "base64", "base64", 1, 5},
-		{"default to float", [][]float32{{0.1, -0.2, 0.3}}, "", "float", 1, 0},
-		{"invalid defaults to float", [][]float32{{0.1, -0.2, 0.3}}, "invalid", "float", 1, 0},
-		{"multiple embeddings", [][]float32{{0.1, 0.2}, {0.3, 0.4}, {0.5, 0.6}}, "base64", "base64", 3, 0},
-		{"empty embeddings", nil, "float", "", 0, 0},
+		{"float format", [][]float32{{0.1, -0.2, 0.3}}, "float", "float", nil, 1, 10},
+		{"base64 format", [][]float32{{0.1, -0.2, 0.3}}, "base64", "base64", []string{"zczMPc3MTL6amZk+"}, 1, 5},
+		{"default to float", [][]float32{{0.1, -0.2, 0.3}}, "", "float", nil, 1, 0},
+		{"invalid defaults to float", [][]float32{{0.1, -0.2, 0.3}}, "invalid", "float", nil, 1, 0},
+		{"multiple embeddings", [][]float32{{0.1, 0.2}, {0.3, 0.4}, {0.5, 0.6}}, "base64", "base64", []string{"zczMPc3MTD4=", "mpmZPs3MzD4=", "AAAAP5qZGT8="}, 3, 0},
+		{"empty embeddings", nil, "float", "", nil, 0, 0},
 	}
 
 	for _, tc := range testCases {
@@ -56,11 +57,24 @@ func TestToEmbeddingList(t *testing.T) {
 					t.Errorf("expected []float32, got %T", result.Data[0].Embedding)
 				}
 			case "base64":
-				embStr, ok := result.Data[0].Embedding.(string)
-				if !ok {
-					t.Errorf("expected string, got %T", result.Data[0].Embedding)
-				} else if _, err := base64.StdEncoding.DecodeString(embStr); err != nil {
-					t.Errorf("invalid base64: %v", err)
+				for i, data := range result.Data {
+					embStr, ok := data.Embedding.(string)
+					if !ok {
+						t.Errorf("embedding %d: expected string, got %T", i, data.Embedding)
+						continue
+					}
+
+					// Verify it's valid base64
+					if _, err := base64.StdEncoding.DecodeString(embStr); err != nil {
+						t.Errorf("embedding %d: invalid base64: %v", i, err)
+					}
+
+					// Compare against expected base64 string if provided
+					if tc.expectBase64 != nil && i < len(tc.expectBase64) {
+						if embStr != tc.expectBase64[i] {
+							t.Errorf("embedding %d: expected base64 %q, got %q", i, tc.expectBase64[i], embStr)
+						}
+					}
 				}
 			}
Repository: rust-lang/rust
Pull request: tests/ui/async-await/gat-is-send-across-await.rs: New regression test

The test began passing in `nightly-2025-10-16`. Probably by c50aebba787 (rust-lang/rust#144064) because it fixed two "does not live long enough" errors. The test fails to compile with `nightly-2025-10-15` with such an error:

    $ rustc +nightly-2025-10-15 --edition 2018 tests/ui/async-await/gat-is-send-across-await.rs
    error: `impl G` does not live long enough
      --> tests/ui/async-await/gat-is-send-across-await.rs:16:24
       |
    16 |       let _: &dyn Send = &async move {
       |  ________________________^
    17 | |         let _gat = g.as_gat();
    18 | |         async{}.await
    19 | |     };
       | |_____^

Closes rust-lang/rust#111852 since that's where the test comes from.

Changed files:
filename: tests/ui/async-await/gat-is-send-across-await.rs
patch: @@ -0,0 +1,23 @@
+//! Regression test for <https://github.com/rust-lang/rust/issues/111852>.
+
+//@ edition:2018
+//@ check-pass
+
+#![allow(unused)]
+
+trait G: Send {
+    type Gat<'l>: Send
+    where
+        Self: 'l;
+
+    fn as_gat(&self) -> Self::Gat<'_>;
+}
+
+fn a(g: impl G) {
+    let _: &dyn Send = &async move {
+        let _gat = g.as_gat();
+        async{}.await
+    };
+}
+
+fn main() { }
Repository: vercel/next.js
Pull request: test: remove stray TURBOPACK_BUILD=1

Forgot to remove this in https://github.com/vercel/next.js/pull/83335

This env var might filter some tests that should actually run (Webpack doesn't set it at all)

Changed files:
filename: .github/workflows/test_e2e_deploy_release.yml
patch: @@ -133,7 +133,6 @@ jobs:
         NEXT_E2E_TEST_TIMEOUT=240000 \
         NEXT_TEST_MODE=deploy \
         IS_TURBOPACK_TEST=1 \
-        TURBOPACK_BUILD=1 \
         NEXT_TEST_CONTINUE_ON_ERROR="${{ github.event.inputs.continueOnError || false }}" \
         NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json" \
         NEXT_TEST_VERSION="${{ github.event.inputs.nextVersion || needs.setup.outputs.next-version || 'canary' }}" \
Repository: rust-lang/rust
Pull request: Document consteval behavior of ub_checks, overflow_checks, is_val_statically_known.

<!-- homu-ignore:start -->
<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r? <reviewer name>
-->
<!-- homu-ignore:end -->


Changed files:
filename: library/core/src/intrinsics/mod.rs
patch: @@ -2502,14 +2502,6 @@ pub(crate) macro const_eval_select {
 /// particular value, ever. However, the compiler will generally make it
 /// return `true` only if the value of the argument is actually known.
 ///
-/// # Stability concerns
-///
-/// While it is safe to call, this intrinsic may behave differently in
-/// a `const` context than otherwise. See the [`const_eval_select()`]
-/// documentation for an explanation of the issues this can cause. Unlike
-/// `const_eval_select`, this intrinsic isn't guaranteed to behave
-/// deterministically even in a `const` context.
-///
 /// # Type Requirements
 ///
 /// `T` must be either a `bool`, a `char`, a primitive numeric type (e.g. `f32`,
@@ -2590,6 +2582,12 @@ pub const unsafe fn typed_swap_nonoverlapping<T>(x: *mut T, y: *mut T) {
 /// assertions are enabled whenever the *user crate* has UB checks enabled. However, if the
 /// user has UB checks disabled, the checks will still get optimized out. This intrinsic is
 /// primarily used by [`crate::ub_checks::assert_unsafe_precondition`].
+///
+/// # Consteval
+///
+/// In consteval, this function currently returns `true`. This is because the value of the `ub_checks`
+/// configuration can differ across crates, but we need this function to always return the same
+/// value in consteval in order to avoid unsoundness.
 #[rustc_intrinsic_const_stable_indirect] // just for UB checks
 #[inline(always)]
 #[rustc_intrinsic]
@@ -2609,6 +2607,12 @@ pub const fn ub_checks() -> bool {
 /// `#[inline]`), gating assertions on `overflow_checks()` rather than `cfg!(overflow_checks)` means that
 /// assertions are enabled whenever the *user crate* has overflow checks enabled. However if the
 /// user has overflow checks disabled, the checks will still get optimized out.
+///
+/// # Consteval
+///
+/// In consteval, this function currently returns `true`. This is because the value of the `overflow_checks`
+/// configuration can differ across crates, but we need this function to always return the same
+/// value in consteval in order to avoid unsoundness.
 #[inline(always)]
 #[rustc_intrinsic]
 pub const fn overflow_checks() -> bool {
Repository: facebook/react
Pull request: Revert [eprh] Remove hermes-parser

Adds back HermesParser to eslint-plugin-react-hooks. There are still [external users of Flow](https://github.com/facebook/react/pull/34719#issuecomment-3368137743) using the plugin, so we shouldn't break the plugin for them. However, we still have the problem of double parsing: once from eslint (which we discard) and then another via babel/hermes parser.

In the long run we should investigate a translation layer from estree to babel (or alternatively, update the compiler to take estree as input). But for now, I am reverting the PR.

This does mean that [Sandpack in react.dev](https://github.com/reactjs/react.dev/blob/11cb6b591571caf5fa2a192117b6a6445c3f2027/src/components/MDX/Sandpack/runESLint.tsx#L31) cannot update to the latest eprh as HermesParser does not appear to be able to be run in a browser. I discovered this while trying to update eprh on react.dev last week, but didn't investigate deeply. I'll need to double check that again to find out more.


Changed files:
filename: packages/eslint-plugin-react-hooks/package.json
patch: @@ -41,6 +41,7 @@
   "dependencies": {
     "@babel/core": "^7.24.4",
     "@babel/parser": "^7.24.4",
+    "hermes-parser": "^0.25.1",
     "zod": "^3.22.4 || ^4.0.0",
     "zod-validation-error": "^3.0.3 || ^4.0.0"
   },

filename: packages/eslint-plugin-react-hooks/src/shared/RunReactCompiler.ts
patch: @@ -17,6 +17,7 @@ import BabelPluginReactCompiler, {
   LoggerEvent,
 } from 'babel-plugin-react-compiler';
 import type {SourceCode} from 'eslint';
+import * as HermesParser from 'hermes-parser';
 import {isDeepStrictEqual} from 'util';
 import type {ParseResult} from '@babel/parser';
 
@@ -113,14 +114,28 @@ function runReactCompilerImpl({
   }
 
   let babelAST: ParseResult<File> | null = null;
-  try {
-    babelAST = babelParse(sourceCode.text, {
-      sourceFilename: filename,
-      sourceType: 'unambiguous',
-      plugins: ['typescript', 'jsx'],
-    });
-  } catch (err: unknown) {
-    /* empty */
+
+  if (filename.endsWith('.tsx') || filename.endsWith('.ts')) {
+    try {
+      babelAST = babelParse(sourceCode.text, {
+        sourceFilename: filename,
+        sourceType: 'unambiguous',
+        plugins: ['typescript', 'jsx'],
+      });
+    } catch {
+      /* empty */
+    }
+  } else {
+    try {
+      babelAST = HermesParser.parse(sourceCode.text, {
+        babel: true,
+        enableExperimentalComponentSyntax: true,
+        sourceFilename: filename,
+        sourceType: 'module',
+      });
+    } catch {
+      /* empty */
+    }
   }
 
   if (babelAST != null) {
Repository: ollama/ollama
Pull request: gemma3: make embedding non-causal


Changed files:
filename: model/models/gemma3/embed.go
patch: @@ -2,7 +2,6 @@ package gemma3
 
 import (
 	"github.com/ollama/ollama/fs"
-	"github.com/ollama/ollama/kvcache"
 	"github.com/ollama/ollama/ml"
 	"github.com/ollama/ollama/ml/nn"
 	"github.com/ollama/ollama/ml/nn/pooling"
@@ -53,10 +52,5 @@ func newEmbedModel(c fs.Config) (model.Model, error) {
 		poolingType: pooling.Type(c.Uint("pooling_type", 0)),
 	}
 
-	m.Cache = kvcache.NewWrapperCache(
-		kvcache.NewSWACache(int32(c.Uint("attention.sliding_window")), m.Shift),
-		kvcache.NewCausalCache(m.Shift),
-	)
-
 	return m, nil
 }

filename: model/models/gemma3/model_text.go
patch: @@ -182,16 +182,18 @@ func (m *TextModel) Forward(ctx ml.Context, batch input.Batch, cache kvcache.Cac
 	for i, layer := range m.Layers {
 		// gemma alternates between the sliding window (local) and causal (global)
 		// kv cache every 6 layers
-		cacheType := cacheTypeSWA
-		if (i+1)%gemmaGlobalCacheCount == 0 {
-			cacheType = cacheTypeCausal
-		}
-		cache.SetLayer(i)
-		wc := cache.(*kvcache.WrapperCache)
-		wc.SetLayerType(cacheType)
-
-		if causal, ok := wc.UnderlyingCache().(*kvcache.Causal); ok {
-			causal.SetCausal(ctx, kvcache.CausalOptions{Except: except})
+		if cache != nil {
+			cacheType := cacheTypeSWA
+			if (i+1)%gemmaGlobalCacheCount == 0 {
+				cacheType = cacheTypeCausal
+			}
+			cache.SetLayer(i)
+			wc := cache.(*kvcache.WrapperCache)
+			wc.SetLayerType(cacheType)
+
+			if causal, ok := wc.UnderlyingCache().(*kvcache.Causal); ok {
+				causal.SetCausal(ctx, kvcache.CausalOptions{Except: except})
+			}
 		}
 
 		var lastLayerOutputs ml.Tensor