helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: Correct typo in error message

The spelling of the term "request" has been corrected, which was previously mistakenly written as "requeset" in the error log message.

Changed files:
filename: server/sched.go
patch: @@ -220,7 +220,7 @@ func (s *Scheduler) processCompleted(ctx context.Context) {
 			runner := s.loaded[finished.model.ModelPath]
 			s.loadedMu.Unlock()
 			if runner == nil {
-				slog.Error("finished requeset signal received after model unloaded", "modelPath", finished.model.ModelPath)
+				slog.Error("finished request signal received after model unloaded", "modelPath", finished.model.ModelPath)
 				continue
 			}
 			runner.refMu.Lock()
Repository: facebook/react
Pull request: [compiler] Fix broken tests

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #31081
* __->__ #31078



Changed files:
filename: .github/workflows/compiler_playground.yml
patch: @@ -36,4 +36,4 @@ jobs:
           key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
       - run: yarn install --frozen-lockfile
       - run: npx playwright install --with-deps chromium
-      - run: yarn test
+      - run: yarn workspace playground test

filename: compiler/apps/playground/scripts/link-react-compiler-runtime.sh
patch: @@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) Meta Platforms, Inc. and affiliates.
-#
-# This source code is licensed under the MIT license found in the
-# LICENSE file in the root directory of this source tree.
-
-set -eo pipefail
-
-HERE=$(pwd)
-
-cd ../../packages/react-compiler-runtime && yarn --silent link
-cd $HERE && yarn --silent link react-compiler-runtime

filename: compiler/package.json
patch: @@ -2,7 +2,12 @@
   "private": true,
   "workspaces": {
     "packages": [
-      "packages/*"
+      "packages/*",
+      "apps/*"
+    ],
+    "nohoist": [
+      "**/next",
+      "**/next/**"
     ]
   },
   "repository": {
@@ -19,7 +24,7 @@
     "test": "yarn workspaces run test",
     "snap": "yarn workspace babel-plugin-react-compiler run snap",
     "snap:build": "yarn workspace snap run build",
-    "postinstall": "perl -p -i -e 's/react\\.element/react.transitional.element/' node_modules/fbt/lib/FbtReactUtil.js && perl -p -i -e 's/didWarnAboutUsingAct = false;/didWarnAboutUsingAct = true;/' node_modules/react-dom/cjs/react-dom-test-utils.development.js",
+    "postinstall": "perl -p -i -e 's/react\\.element/react.transitional.element/' packages/snap/node_modules/fbt/lib/FbtReactUtil.js && perl -p -i -e 's/didWarnAboutUsingAct = false;/didWarnAboutUsingAct = true;/' packages/babel-plugin-react-compiler/node_modules/react-dom/cjs/react-dom-test-utils.development.js",
     "npm:publish": "node scripts/release/publish"
   },
   "dependencies": {
Repository: facebook/react
Pull request: [ci] Fix incorrect sha / commit messages in manual Meta builds

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #31083



Changed files:
filename: .github/workflows/runtime_commit_artifacts.yml
patch: @@ -82,7 +82,7 @@ jobs:
         working-directory: scripts/release
       - name: Download artifacts for base revision
         run: |
-          GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.sha }}
+          GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }}
       - name: Display structure of build
         run: ls -R build
       - name: Strip @license from eslint plugin and react-refresh
@@ -245,9 +245,9 @@ jobs:
         uses: stefanzweifel/git-auto-commit-action@v5
         with:
           commit_message: |
-            ${{ github.event.workflow_run.head_commit.message || 'No commit message' }}
+            ${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
 
-            DiffTrain build for [${{ github.sha }}](https://github.com/facebook/react/commit/${{ github.sha }})
+            DiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha }})
           branch: builds/facebook-www
           commit_user_name: ${{ github.triggering_actor }}
           commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
@@ -412,9 +412,9 @@ jobs:
         uses: stefanzweifel/git-auto-commit-action@v5
         with:
           commit_message: |
-            ${{ github.event.workflow_run.head_commit.message || 'No commit message' }}
+            ${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
 
-            DiffTrain build for [${{ github.sha }}](https://github.com/facebook/react/commit/${{ github.sha }})
+            DiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha }})
           branch: builds/facebook-fbsource
           commit_user_name: ${{ github.triggering_actor }}
           commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
Repository: huggingface/transformers
Pull request: extend 2 trainer test cases to xpu

@ydshieh, pls help review, thx very much.

Changed files:
filename: tests/trainer/test_trainer.py
patch: @@ -4142,7 +4142,7 @@ def test_fp16_full_eval(self):
             # perfect world: fp32_init/2 == fp16_eval
             self.assertAlmostEqual(fp16_eval, fp32_init / 2, delta=5_000)
 
-    @require_torch_gpu
+    @require_torch_accelerator
     @pytest.mark.torch_compile_test
     def test_torch_compile_train(self):
         with tempfile.TemporaryDirectory() as tmp_dir:
@@ -4154,7 +4154,7 @@ def test_torch_compile_train(self):
             metrics = trainer.train()
             self.assertAlmostEqual(metrics.training_loss, original_train_loss)
 
-    @require_torch_gpu
+    @require_torch_accelerator
     @pytest.mark.torch_compile_test
     def test_torch_compile_eval(self):
         with tempfile.TemporaryDirectory() as tmp_dir:
@@ -4165,7 +4165,7 @@ def test_torch_compile_eval(self):
             trainer = get_regression_trainer(torch_compile=True, output_dir=tmp_dir)
             metrics = trainer.evaluate()
 
-            self.assertAlmostEqual(metrics["eval_loss"], original_eval_loss)
+            self.assertAlmostEqual(metrics["eval_loss"], original_eval_loss, delta=1e-6)
 
     @require_torch_accelerator
     @require_torch_bf16
Repository: electron/electron
Pull request: fix: window content protection on older Windows versions

#### Description of Change

Closes https://github.com/electron/electron/issues/47834

We need to bring back the initial solution from https://github.com/electron/electron/issues/31340 - it looks like the black window issue has gone away but there remain issues with capture on older OSes where calling `SetWindowDisplayAffinity` on windows without `WS_EX_LAYERED` will expose the window.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: Fixed an issue on some older Windows versions where `setContentProtection` didn't work as expected.


Changed files:
filename: shell/browser/native_window_views.cc
patch: @@ -1282,12 +1282,7 @@ void NativeWindowViews::SetOpacity(const double opacity) {
 #if BUILDFLAG(IS_WIN)
   const double boundedOpacity = std::clamp(opacity, 0.0, 1.0);
   HWND hwnd = GetAcceleratedWidget();
-  if (!layered_) {
-    LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
-    ex_style |= WS_EX_LAYERED;
-    ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
-    layered_ = true;
-  }
+  SetLayered();
   ::SetLayeredWindowAttributes(hwnd, 0, boundedOpacity * 255, LWA_ALPHA);
   opacity_ = boundedOpacity;
 #else
@@ -1730,6 +1725,16 @@ void NativeWindowViews::UpdateThickFrame() {
     FlipWindowStyle(GetAcceleratedWidget(), resizable_, WS_THICKFRAME);
   }
 }
+
+void NativeWindowViews::SetLayered() {
+  HWND hwnd = GetAcceleratedWidget();
+  if (!layered_) {
+    LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
+    ex_style |= WS_EX_LAYERED;
+    ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
+    layered_ = true;
+  }
+}
 #endif
 
 void NativeWindowViews::OnWidgetActivationChanged(views::Widget* changed_widget,

filename: shell/browser/native_window_views.h
patch: @@ -178,6 +178,7 @@ class NativeWindowViews : public NativeWindow,
 #if BUILDFLAG(IS_WIN)
   TaskbarHost& taskbar_host() { return taskbar_host_; }
   void UpdateThickFrame();
+  void SetLayered();
 #endif
 
   SkColor overlay_button_color() const { return overlay_button_color_; }

filename: shell/browser/ui/win/electron_desktop_window_tree_host_win.cc
patch: @@ -176,6 +176,11 @@ void ElectronDesktopWindowTreeHostWin::UpdateAllowScreenshots() {
   if (allowed == allow_screenshots_)
     return;
 
+  // On some older Windows versions, setting the display affinity
+  // to WDA_EXCLUDEFROMCAPTURE won't prevent the window from being
+  // captured - setting WS_EX_LAYERED mitigates this issue.
+  if (base::win::GetVersion() < base::win::Version::WIN11_22H2)
+    native_window_view_->SetLayered();
   ::SetWindowDisplayAffinity(
       GetAcceleratedWidget(),
       allow_screenshots_ ? WDA_NONE : WDA_EXCLUDEFROMCAPTURE);
Repository: ggml-org/llama.cpp
Pull request: Linux Direct I/O: handle short reads to avoid corrupted weights during inference

After updating to latest, I started seeing obviously wrong behavior during inference on Linux (repeated / “stuck” output patterns). Model loading looked fine, so I initially chased it as a sampling / runtime issue. Eventually it became pretty clear it was corrupted weights making it onto the device.

This is caused by the Linux Direct I/O change introduced in #18012 (Async DirectIO model loading on Linux).

Root cause is in the O_DIRECT read path. On Linux, read() with O_DIRECT can legitimately return a short read. That’s not an error, and it does not imply EOF. The current implementation effectively assumes “any successful read completes the request”, which means we can leave part of the destination buffer untouched. When that buffer is used for tensor uploads, you end up with partially stale/uninitialized bytes. The loader doesn’t necessarily fail, but inference quality goes off a cliff in exactly the kind of repetitive pattern you’d expect from corrupted weights.

Fix is intentionally minimal and only touches the direct I/O path:
- Loop until the full requested length is read (retry on EINTR).
- If we hit EOF only because an aligned direct I/O read rounded the request past the real end of the file, zero-fill the remainder and return. That’s just padding and should not be treated as a hard failure.

With this change, the inference corruption goes away on my setup with Direct I/O enabled, and no unrelated code paths are touched.


Changed files:
filename: src/llama-mmap.cpp
patch: @@ -240,9 +240,10 @@ struct llama_file::impl {
                 throw std::runtime_error("unexpectedly reached end of file");
             }
         } else {
-            bool successful = false;
-            while (!successful) {
-                off_t ret = read(fd, ptr, len);
+            size_t bytes_read = 0;
+            while (bytes_read < len) {
+                const size_t to_read = len - bytes_read;
+                ssize_t ret = ::read(fd, reinterpret_cast<char *>(ptr) + bytes_read, to_read);
 
                 if (ret == -1) {
                     if (errno == EINTR) {
@@ -251,10 +252,16 @@ struct llama_file::impl {
                     throw std::runtime_error(format("read error: %s", strerror(errno)));
                 }
                 if (ret == 0) {
+                    // EOF: allow if this read was only pulling alignment padding past file end
+                    off_t pos = lseek(fd, 0, SEEK_CUR);
+                    if (pos != -1 && (size_t) pos == size) {
+                        std::memset(reinterpret_cast<char *>(ptr) + bytes_read, 0, len - bytes_read);
+                        return;
+                    }
                     throw std::runtime_error("unexpectedly reached end of file");
                 }
 
-                successful = true;
+                bytes_read += (size_t) ret;
             }
         }
     }
Repository: ggml-org/llama.cpp
Pull request: chat: make tool description and parameters optional per OpenAI spec

## Summary
- Makes `description` and `parameters` fields optional in tool function definitions
- Per the [OpenAI API specification](https://platform.openai.com/docs/api-reference/chat/create#chat_create-tools-function_tool-function-parameters), these fields are optional
- Previously, the parser would throw an exception if these fields were missing

## Test plan
- [x] Added test for tools without `parameters` field
- [x] Added test for tools without `description` field  
- [x] Added test for tools with only `name` (minimal valid tool)
- [x] Existing tests still pass

Attempts to fix #17667

Changed files:
filename: common/chat.cpp
patch: @@ -380,8 +380,8 @@ std::vector<common_chat_tool> common_chat_tools_parse_oaicompat(const json & too
                 const auto & function = tool.at("function");
                 result.push_back({
                     /* .name = */ function.at("name"),
-                    /* .description = */ function.at("description"),
-                    /* .parameters = */ function.at("parameters").dump(),
+                    /* .description = */ function.value("description", ""),
+                    /* .parameters = */ function.value("parameters", json::object()).dump(),
                 });
             }
         }

filename: tests/test-chat.cpp
patch: @@ -724,6 +724,30 @@ static void test_tools_oaicompat_json_conversion() {
             "]"
         ),
         common_chat_tools_to_json_oaicompat<json>({special_function_tool}).dump(2));
+
+    {
+        auto tools_no_params = common_chat_tools_parse_oaicompat(json::parse(
+            R"([{"type": "function", "function": {"name": "test_func", "description": "A test"}}])"));
+        assert_equals((size_t) 1, tools_no_params.size());
+        assert_equals(std::string("test_func"), tools_no_params[0].name);
+        assert_equals(std::string("A test"), tools_no_params[0].description);
+        assert_equals(std::string("{}"), tools_no_params[0].parameters);
+    }
+    {
+        auto tools_no_desc = common_chat_tools_parse_oaicompat(json::parse(
+            R"([{"type": "function", "function": {"name": "test_func", "parameters": {"type": "object"}}}])"));
+        assert_equals((size_t) 1, tools_no_desc.size());
+        assert_equals(std::string("test_func"), tools_no_desc[0].name);
+        assert_equals(std::string(""), tools_no_desc[0].description);
+    }
+    {
+        auto tools_minimal = common_chat_tools_parse_oaicompat(json::parse(
+            R"([{"type": "function", "function": {"name": "test_func"}}])"));
+        assert_equals((size_t) 1, tools_minimal.size());
+        assert_equals(std::string("test_func"), tools_minimal[0].name);
+        assert_equals(std::string(""), tools_minimal[0].description);
+        assert_equals(std::string("{}"), tools_minimal[0].parameters);
+    }
 }
 
 static void test_template_output_parsers() {
Repository: electron/electron
Pull request: fix: window content protection on older Windows versions

Backport of #47856

See that PR for details.


Notes: Fixed an issue on some older Windows versions where `setContentProtection` didn't work as expected.


Changed files:
filename: shell/browser/native_window_views.cc
patch: @@ -1282,12 +1282,7 @@ void NativeWindowViews::SetOpacity(const double opacity) {
 #if BUILDFLAG(IS_WIN)
   const double boundedOpacity = std::clamp(opacity, 0.0, 1.0);
   HWND hwnd = GetAcceleratedWidget();
-  if (!layered_) {
-    LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
-    ex_style |= WS_EX_LAYERED;
-    ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
-    layered_ = true;
-  }
+  SetLayered();
   ::SetLayeredWindowAttributes(hwnd, 0, boundedOpacity * 255, LWA_ALPHA);
   opacity_ = boundedOpacity;
 #else
@@ -1730,6 +1725,16 @@ void NativeWindowViews::UpdateThickFrame() {
     FlipWindowStyle(GetAcceleratedWidget(), resizable_, WS_THICKFRAME);
   }
 }
+
+void NativeWindowViews::SetLayered() {
+  HWND hwnd = GetAcceleratedWidget();
+  if (!layered_) {
+    LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
+    ex_style |= WS_EX_LAYERED;
+    ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
+    layered_ = true;
+  }
+}
 #endif
 
 void NativeWindowViews::OnWidgetActivationChanged(views::Widget* changed_widget,

filename: shell/browser/native_window_views.h
patch: @@ -178,6 +178,7 @@ class NativeWindowViews : public NativeWindow,
 #if BUILDFLAG(IS_WIN)
   TaskbarHost& taskbar_host() { return taskbar_host_; }
   void UpdateThickFrame();
+  void SetLayered();
 #endif
 
   SkColor overlay_button_color() const { return overlay_button_color_; }

filename: shell/browser/ui/win/electron_desktop_window_tree_host_win.cc
patch: @@ -176,6 +176,11 @@ void ElectronDesktopWindowTreeHostWin::UpdateAllowScreenshots() {
   if (allowed == allow_screenshots_)
     return;
 
+  // On some older Windows versions, setting the display affinity
+  // to WDA_EXCLUDEFROMCAPTURE won't prevent the window from being
+  // captured - setting WS_EX_LAYERED mitigates this issue.
+  if (base::win::GetVersion() < base::win::Version::WIN11_22H2)
+    native_window_view_->SetLayered();
   ::SetWindowDisplayAffinity(
       GetAcceleratedWidget(),
       allow_screenshots_ ? WDA_NONE : WDA_EXCLUDEFROMCAPTURE);
Repository: vercel/next.js
Pull request: Add Activity name to route layouts and pages

This is the name that will be displayed in the Suspense DevTools.

A name is given to any boundary that corresponds to a user-defined layout or page. It omits "virtual" segments that are inserted automatically by the router.

Changed files:
filename: packages/next/src/client/components/layout-router.tsx
patch: @@ -42,6 +42,7 @@ import { hasInterceptionRouteInCurrentTree } from './router-reducer/reducers/has
 import { dispatchAppRouterAction } from './use-action-queue'
 import { useRouterBFCache, type RouterBFCacheEntry } from './bfcache'
 import { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'
+import { PAGE_SEGMENT_KEY } from '../../shared/lib/segment'
 
 /**
  * Add refetch marker to router state at the point of the current layout segment.
@@ -476,6 +477,7 @@ function LoadingBoundary({
     const loadingScripts = loadingModuleData[2]
     return (
       <Suspense
+        name="loading.tsx"
         fallback={
           <>
             {loadingStyles}
@@ -688,8 +690,10 @@ export default function OuterLayoutRouter({
     }
 
     if (process.env.__NEXT_ROUTER_BF_CACHE) {
+      const boundaryName = getBoundaryNameForSuspenseDevTools(tree)
       child = (
         <Activity
+          name={boundaryName}
           key={stateKey}
           mode={stateKey === activeStateKey ? 'visible' : 'hidden'}
         >
@@ -705,3 +709,50 @@ export default function OuterLayoutRouter({
 
   return children
 }
+
+function getBoundaryNameForSuspenseDevTools(
+  subtree: FlightRouterState
+): string | undefined {
+  const segment = subtree[0]
+
+  if (typeof segment === 'string') {
+    const children = subtree[1]
+    const isPage = Object.keys(children).length === 0
+    if (isPage) {
+      // Page segment
+      return '/'
+    }
+
+    // Layout segment
+
+    // Skip over "virtual" layouts that don't correspond to app-
+    // defined components.
+    if (
+      segment === '' ||
+      // For some reason, the loader tree sometimes includes extra __PAGE__
+      // "layouts" when part of a parallel route. But it's not a leaf node.
+      // Otherwise, we wouldn't need this special case because pages are
+      // always leaf nodes.
+      // TODO: Investigate why the loader produces these fake page segments.
+      segment.startsWith(PAGE_SEGMENT_KEY) ||
+      // This is inserted by the loader. We should consider encoding these
+      // in a more special way instead of checking the name, to distinguish them
+      // from app-defined groups.
+      segment[0] === '(virtual)'
+    ) {
+      return undefined
+    }
+
+    if (segment === '/_not-found') {
+      // Special case. For some reason, the name itself already has a
+      // leading slash.
+      return '/_not-found/'
+    }
+
+    return `/${segment}/`
+  }
+
+  // Parameterized segments are always layouts
+  const paramCacheKey = segment[1]
+  return `/${paramCacheKey}/`
+}
Repository: ollama/ollama
Pull request: Add a /clear command

This has came up a couple of times in the issue history where you would like to clear your chat context. It can be annoying to reload a large model.

This adds a new command `/clear` in interactive sessions that just wipes the full chat history.

Let me know if there other considerations I should take into account or other names we may want to have for the command.

Fixes #3937

Changed files:
filename: cmd/interactive.go
patch: @@ -94,6 +94,7 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 		fmt.Fprintln(os.Stderr, "  /show           Show model information")
 		fmt.Fprintln(os.Stderr, "  /load <model>   Load a session or model")
 		fmt.Fprintln(os.Stderr, "  /save <model>   Save your current session")
+		fmt.Fprintln(os.Stderr, "  /clear          Clear session context")
 		fmt.Fprintln(os.Stderr, "  /bye            Exit")
 		fmt.Fprintln(os.Stderr, "  /?, /help       Help for a command")
 		fmt.Fprintln(os.Stderr, "  /? shortcuts    Help for keyboard shortcuts")
@@ -280,6 +281,10 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 			}
 			fmt.Printf("Created new model '%s'\n", args[1])
 			continue
+		case strings.HasPrefix(line, "/clear"):
+			opts.Messages = []api.Message{}
+			fmt.Println("Cleared session context")
+			continue
 		case strings.HasPrefix(line, "/set"):
 			args := strings.Fields(line)
 			if len(args) > 1 {