helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: fix(bundle): let esbuild handle data urls

Fixes #32206.
Instead of resolving them (which forces us to load them), just let esbuild handle them

Changed files:
filename: cli/tools/bundle/mod.rs
patch: @@ -1235,6 +1235,9 @@ impl DenoPluginHandler {
       kind,
       with
     );
+    if path.starts_with("data:") {
+      return Ok(None);
+    }
     let mut resolve_dir = resolve_dir.unwrap_or("").to_string();
     let resolver = self.resolver.clone();
     if !resolve_dir.ends_with(std::path::MAIN_SEPARATOR) {
@@ -1354,6 +1357,9 @@ impl DenoPluginHandler {
       specifier,
       Path::new(""), // should be absolute already, feels kind of hacky though
     )?;
+    if specifier.scheme() == "data" {
+      return Ok(None);
+    }
     let (specifier, media_type) =
       if let RequestedModuleType::Bytes = requested_type {
         (specifier, MediaType::Unknown)
@@ -1370,13 +1376,6 @@ impl DenoPluginHandler {
           specifier
         );
 
-        if specifier.scheme() == "data" {
-          return Ok(Some((
-            specifier.to_string().as_bytes().to_vec(),
-            esbuild_client::BuiltinLoader::DataUrl,
-          )));
-        }
-
         let (media_type, _) =
           deno_media_type::resolve_media_type_and_charset_from_content_type(
             &specifier, None,

filename: tests/specs/bundle/data_url_css/__test__.jsonc
patch: @@ -0,0 +1,8 @@
+{
+  "steps": [
+    {
+      "args": "bundle test.css",
+      "output": "bundle.out"
+    }
+  ]
+}

filename: tests/specs/bundle/data_url_css/bundle.out
patch: @@ -0,0 +1,6 @@
+[WILDCARD]
+/* test.css */
+.test {
+  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='m2 5 6 6 6-6'/></svg>");
+  --test-text: url("data:text/plain;charset=utf-8,Lorem ipsum dolor sit amet");
+}

filename: tests/specs/bundle/data_url_css/test.css
patch: @@ -0,0 +1,4 @@
+.test {
+  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='m2 5 6 6 6-6'/></svg>");
+  --test-text: url("data:text/plain;charset=utf-8,Lorem ipsum dolor sit amet");
+}
\ No newline at end of file
Repository: ggml-org/llama.cpp
Pull request: sycl: add missing BF16 conversion support for Intel oneAPI

When running FLUX2 models in [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) on Intel GPU with oneAPI SYCL backend, this assertion fails:
```
ggml-sycl.cpp:2047: GGML_ASSERT(to_fp32_sycl != nullptr) failed
```

The issue is that `ggml_get_to_fp32_sycl()`, `ggml_get_to_fp16_sycl()`, and `get_to_fp16_nc_sycl()` are missing BF16 conversion cases, causing them to return `nullptr`.

This PR adds the missing BF16 support in `ggml/src/ggml-sycl/convert.cpp`. Uses `sycl::ext::oneapi::bfloat16` (Intel oneAPI only, guarded by `__INTEL_LLVM_COMPILER`).

Changed files:
filename: ggml/src/ggml-sycl/convert.cpp
patch: @@ -2,6 +2,13 @@
 #include "dequantize.hpp"
 #include "presets.hpp"
 
+#if defined(__INTEL_LLVM_COMPILER)
+    #if __has_include(<sycl/ext/oneapi/bfloat16.hpp>)
+        #include <sycl/ext/oneapi/bfloat16.hpp>
+        #define GGML_SYCL_HAS_BF16
+    #endif
+#endif
+
 template <int qk, int qr, dequantize_kernel_t dequantize_kernel, typename dst_t>
 static void dequantize_block(const void * __restrict__ vx, dst_t * __restrict__ y, const int64_t k,
                              const sycl::nd_item<3> &item_ct1) {
@@ -566,6 +573,10 @@ to_fp16_sycl_t ggml_get_to_fp16_sycl(ggml_type type, ggml_tensor * dst) {
             return dequantize_row_iq4_nl_sycl;
         case GGML_TYPE_F32:
             return convert_unary_sycl<float>;
+#ifdef GGML_SYCL_HAS_BF16
+        case GGML_TYPE_BF16:
+            return convert_unary_sycl<sycl::ext::oneapi::bfloat16>;
+#endif
         default:
             return nullptr;
     }
@@ -627,6 +638,10 @@ to_fp32_sycl_t ggml_get_to_fp32_sycl(ggml_type type, ggml_tensor *dst) {
             return dequantize_row_iq4_nl_sycl;
         case GGML_TYPE_F16:
             return convert_unary_sycl<sycl::half>;
+#ifdef GGML_SYCL_HAS_BF16
+        case GGML_TYPE_BF16:
+            return convert_unary_sycl<sycl::ext::oneapi::bfloat16>;
+#endif
         default:
             return nullptr;
     }
@@ -636,6 +651,10 @@ to_fp16_nc_sycl_t get_to_fp16_nc_sycl(ggml_type type) {
     switch (type) {
         case GGML_TYPE_F32:
             return convert_unary_nc_sycl<float>;
+#ifdef GGML_SYCL_HAS_BF16
+        case GGML_TYPE_BF16:
+            return convert_unary_nc_sycl<sycl::ext::oneapi::bfloat16>;
+#endif
         default:
             return nullptr;
     }
Repository: vercel/next.js
Pull request: Show invalid default export errors during prerendering

The specific error messages for invalid default exports in pages, layouts, and error files were only shown in development mode. This change ensures that these errors are also displayed during prerendering, which replaces the unhelpful error messages we were seeing before.

Improving these error messages is the subject of #76330.

closes NAR-272

Changed files:
filename: packages/next/src/server/app-render/create-component-tree.tsx
patch: @@ -371,7 +371,7 @@ async function createComponentTreeInternal(
    */
   let MaybeComponent = LayoutOrPage
 
-  if (process.env.NODE_ENV === 'development') {
+  if (process.env.NODE_ENV === 'development' || isStaticGeneration) {
     const { isValidElementType } =
       require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')
     if (

filename: test/e2e/app-dir/undefined-default-export/undefined-default-export.test.ts
patch: @@ -51,24 +51,24 @@ describe('Undefined default export', () => {
       `)
     })
   } else {
-    it('errors the build with unhelpful error messages', async () => {
+    it('errors the build with helpful error messages', async () => {
       const { cliOutput, exitCode } = await next.build()
 
       expect(exitCode).toBe(1)
 
       expect(cliOutput).toContain(
         `Error occurred prerendering page "/specific-path/1". Read more: https://nextjs.org/docs/messages/prerender-error
-Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.Module`
+Error: The default export is not a React Component in "/specific-path/1/page"`
       )
 
       expect(cliOutput).toContain(
         `Error occurred prerendering page "/specific-path/2". Read more: https://nextjs.org/docs/messages/prerender-error
-Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.`
+Error: The default export is not a React Component in "/specific-path/2/layout"`
       )
 
       expect(cliOutput).toContain(
         `Error occurred prerendering page "/will-not-found". Read more: https://nextjs.org/docs/messages/prerender-error
-Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.Module`
+Error: The default export is not a React Component in "/will-not-found/not-found"`
       )
     })
   }
Repository: facebook/react
Pull request: Fixed  `useSyncExternalStoreWithSelector` to update memoizedSnapshot on change

## Summary

<!--
 Explain the **motivation** for making this change. What existing problem does the pull request solve?
-->

A proposed fix for the bug described in https://github.com/facebook/react/issues/25967

## How did you test this change?

See the issue linked above, test scenario included in the code sandbox: https://codesandbox.io/s/fervent-ives-0vm9es?file=/src/App.jsx

<!--
  Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface.
  How exactly did you verify that your PR solves the issue you wanted to solve?
  If you leave this empty, your PR will very likely be closed.
-->


Changed files:
filename: packages/use-sync-external-store/src/useSyncExternalStoreWithSelector.js
patch: @@ -93,6 +93,9 @@ export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
       // to React that the selections are conceptually equal, and we can bail
       // out of rendering.
       if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
+        // The snapshot still has changed, so make sure to update to not keep
+        // old references alive
+        memoizedSnapshot = nextSnapshot;
         return prevSelection;
       }
Repository: ollama/ollama
Pull request: Add Radeon gfx940-942 GPU support

Looking at the Tensor files in ROCm v6, I noticed these newer gfx types were present, but we're not compiling them in.  (e.g. this would cover the new MI300X GPU)

Changed files:
filename: llm/generate/gen_linux.sh
patch: @@ -26,6 +26,9 @@ amdGPUs() {
         "gfx908:xnack-"
         "gfx90a:xnack+"
         "gfx90a:xnack-"
+        "gfx940"
+        "gfx941"
+        "gfx942"
         "gfx1010"
         "gfx1012"
         "gfx1030"

filename: llm/generate/gen_windows.ps1
patch: @@ -13,6 +13,9 @@ function amdGPUs {
         "gfx908:xnack-"
         "gfx90a:xnack+"
         "gfx90a:xnack-"
+        "gfx940"
+        "gfx941"
+        "gfx942"
         "gfx1010"
         "gfx1012"
         "gfx1030"
Repository: nodejs/node
Pull request: src: check import attributes value types as strings

Import attribute key and value only support literal string values. Add DCHECKs to ensure that the types are expected.

Changed files:
filename: src/module_wrap.cc
patch: @@ -63,6 +63,10 @@ using v8::UnboundModuleScript;
 using v8::Undefined;
 using v8::Value;
 
+inline bool DataIsString(Local<Data> data) {
+  return data->IsValue() && data.As<Value>()->IsString();
+}
+
 void ModuleCacheKey::MemoryInfo(MemoryTracker* tracker) const {
   tracker->TrackField("specifier", specifier);
   tracker->TrackField("import_attributes", import_attributes);
@@ -83,6 +87,9 @@ ModuleCacheKey ModuleCacheKey::From(Local<Context> context,
 
   for (int i = 0; i < import_attributes->Length();
        i += elements_per_attribute) {
+    DCHECK(DataIsString(import_attributes->Get(context, i)));
+    DCHECK(DataIsString(import_attributes->Get(context, i + 1)));
+
     Local<String> v8_key = import_attributes->Get(context, i).As<String>();
     Local<String> v8_value =
         import_attributes->Get(context, i + 1).As<String>();
@@ -488,9 +495,14 @@ static Local<Object> createImportAttributesContainer(
   LocalVector<Value> values(isolate, num_attributes);
 
   for (int i = 0; i < raw_attributes->Length(); i += elements_per_attribute) {
+    Local<Data> key = raw_attributes->Get(realm->context(), i);
+    Local<Data> value = raw_attributes->Get(realm->context(), i + 1);
+    DCHECK(DataIsString(key));
+    DCHECK(DataIsString(value));
+
     int idx = i / elements_per_attribute;
-    names[idx] = raw_attributes->Get(realm->context(), i).As<Name>();
-    values[idx] = raw_attributes->Get(realm->context(), i + 1).As<Value>();
+    names[idx] = key.As<String>();
+    values[idx] = value.As<String>();
   }
 
   Local<Object> attributes = Object::New(
@@ -507,6 +519,7 @@ static Local<Array> createModuleRequestsContainer(
   LocalVector<Value> requests(isolate, raw_requests->Length());
 
   for (int i = 0; i < raw_requests->Length(); i++) {
+    DCHECK(raw_requests->Get(context, i)->IsModuleRequest());
     Local<ModuleRequest> module_request =
         raw_requests->Get(realm->context(), i).As<ModuleRequest>();
Repository: electron/electron
Pull request: fix: addChildView() crashes when adding a closed WebContentsView

Backport of #47099

See that PR for details.


Notes: Fixed `addChildView()` crashes when adding a closed WebContentsView


Changed files:
filename: shell/browser/api/electron_api_view.cc
patch: @@ -216,6 +216,12 @@ void View::AddChildViewAt(gin::Handle<View> child,
   if (!view_)
     return;
 
+  if (!child->view()) {
+    gin_helper::ErrorThrower(isolate()).ThrowError(
+        "Can't add a destroyed child view to a parent view");
+    return;
+  }
+
   // This will CHECK and crash in View::AddChildViewAtImpl if not handled here.
   if (view_ == child->view()) {
     gin_helper::ErrorThrower(isolate()).ThrowError(

filename: spec/api-web-contents-view-spec.ts
patch: @@ -55,6 +55,20 @@ describe('WebContentsView', () => {
     })).to.throw('options.webContents is already attached to a window');
   });
 
+  it('should throw an error when adding a destroyed child view to the parent view', async () => {
+    const browserWindow = new BrowserWindow();
+
+    const webContentsView = new WebContentsView();
+    webContentsView.webContents.loadURL('about:blank');
+    webContentsView.webContents.destroy();
+
+    const destroyed = once(webContentsView.webContents, 'destroyed');
+    await destroyed;
+    expect(() => browserWindow.contentView.addChildView(webContentsView)).to.throw(
+      'Can\'t add a destroyed child view to a parent view'
+    );
+  });
+
   it('should throw error when created with already attached webContents to other WebContentsView', () => {
     const browserWindow = new BrowserWindow();
Repository: ggml-org/llama.cpp
Pull request: ggml-cpu: detect correct cpu flags for arm64 (#16229)

When using GCC 9 and GCC 12 on the arm64 platform of ubuntu 2004, the command "gcc -mcpu=native -E -v -" fails to detect the correct CPU flags, which results in compilation failures for certain extended instructions, but the correct CPU flags can be obtained by using gcc -march.

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*


Changed files:
filename: ggml/src/ggml-cpu/CMakeLists.txt
patch: @@ -118,18 +118,18 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
                 # so we check for them manually and enable them if available
 
                 execute_process(
-                    COMMAND ${CMAKE_C_COMPILER} -mcpu=native -E -v -
+                    COMMAND ${CMAKE_C_COMPILER} -march=native -E -v -
                     INPUT_FILE "/dev/null"
                     OUTPUT_QUIET
                     ERROR_VARIABLE ARM_MCPU
                     RESULT_VARIABLE ARM_MCPU_RESULT
                 )
                 if (NOT ARM_MCPU_RESULT)
-                    string(REGEX MATCH "-mcpu=[^ ']+" ARM_MCPU_FLAG "${ARM_MCPU}")
+                    string(REGEX MATCH "-march=[^ ']+" ARM_MCPU_FLAG "${ARM_MCPU}")
                 endif()
                 if ("${ARM_MCPU_FLAG}" STREQUAL "")
-                    set(ARM_MCPU_FLAG -mcpu=native)
-                    message(STATUS "ARM -mcpu not found, -mcpu=native will be used")
+                    set(ARM_MCPU_FLAG -march=native)
+                    message(STATUS "ARM -mcpu not found, -march=native will be used")
                 endif()
 
                 include(CheckCXXSourceRuns)
Repository: vercel/next.js
Pull request: Turbopack: make persistent caching log line more clear

### What?

Make it clear that the log line is related to persistent caching

Closes PACK-5581

Changed files:
filename: turbopack/crates/turbo-tasks-backend/src/database/turbo/mod.rs
patch: @@ -104,12 +104,16 @@ impl KeyValueDatabase for TurboKeyValueDatabase {
         // Compact the database on shutdown
         if self.is_ci {
             // Fully compact in CI to reduce cache size
-            do_compact(&self.db, "Finished database compaction", usize::MAX)?;
+            do_compact(
+                &self.db,
+                "Finished persistent caching database compaction",
+                usize::MAX,
+            )?;
         } else {
             // Compact with a reasonable limit in non-CI environments
             do_compact(
                 &self.db,
-                "Finished database compaction",
+                "Finished persistent caching database compaction",
                 available_parallelism().map_or(4, |c| max(4, c.get())),
             )?;
         }
@@ -167,7 +171,7 @@ impl<'a> BaseWriteBatch<'a> for TurboWriteBatch<'a> {
             let handle = spawn(async move {
                 do_compact(
                     &db,
-                    "Finished database compaction",
+                    "Finished persistent caching database compaction",
                     available_parallelism().map_or(4, |c| max(4, c.get() / 2)),
                 )
             });
Repository: ollama/ollama
Pull request: llm,readline: use errors.Is instead of simple == check

This fixes some brittle, simple equality checks to use errors.Is. Since go1.13, errors.Is is the idiomatic way to check for errors.

Changed files:
filename: llm/gguf.go
patch: @@ -3,6 +3,7 @@ package llm
 import (
 	"bytes"
 	"encoding/binary"
+	"errors"
 	"fmt"
 	"io"
 	"log/slog"
@@ -540,7 +541,7 @@ func (llm *GGUFModel) Encode(f *os.File) error {
 			b, err := io.ReadFull(dataFile, data)
 			remaining -= uint64(b)
 
-			if err == io.EOF || remaining <= 0 {
+			if errors.Is(err, io.EOF) || remaining <= 0 {
 				finished = true
 			} else if err != nil {
 				return err

filename: llm/payload_common.go
patch: @@ -113,7 +113,7 @@ func nativeInit() error {
 
 	libs, err := extractDynamicLibs(payloadsDir, "llama.cpp/build/*/*/*/lib/*")
 	if err != nil {
-		if err == payloadMissing {
+		if errors.Is(err, payloadMissing) {
 			slog.Info(fmt.Sprintf("%s", payloadMissing))
 			return nil
 		}

filename: readline/history.go
patch: @@ -62,7 +62,7 @@ func (h *History) Init() error {
 	for {
 		line, err := r.ReadString('\n')
 		if err != nil {
-			if err == io.EOF {
+			if errors.Is(err, io.EOF) {
 				break
 			}
 			return err
Repository: facebook/react
Pull request: [Flight] Consistently flag debugOwner field

This is available outside `enableOwnerStack` but we weren't consistently using it and so it has different hidden classes.

Changed files:
filename: packages/react-server/src/ReactFlightServer.js
patch: @@ -618,7 +618,7 @@ function serializeThenable(
     task.keyPath, // the server component sequence continues through Promise-as-a-child.
     task.implicitSlot,
     request.abortableTasks,
-    __DEV__ && enableOwnerStacks ? task.debugOwner : null,
+    __DEV__ ? task.debugOwner : null,
     __DEV__ && enableOwnerStacks ? task.debugStack : null,
     __DEV__ && enableOwnerStacks ? task.debugTask : null,
   );
@@ -750,7 +750,7 @@ function serializeReadableStream(
     task.keyPath,
     task.implicitSlot,
     request.abortableTasks,
-    __DEV__ && enableOwnerStacks ? task.debugOwner : null,
+    __DEV__ ? task.debugOwner : null,
     __DEV__ && enableOwnerStacks ? task.debugStack : null,
     __DEV__ && enableOwnerStacks ? task.debugTask : null,
   );
@@ -849,7 +849,7 @@ function serializeAsyncIterable(
     task.keyPath,
     task.implicitSlot,
     request.abortableTasks,
-    __DEV__ && enableOwnerStacks ? task.debugOwner : null,
+    __DEV__ ? task.debugOwner : null,
     __DEV__ && enableOwnerStacks ? task.debugStack : null,
     __DEV__ && enableOwnerStacks ? task.debugTask : null,
   );
@@ -1572,7 +1572,7 @@ function outlineTask(request: Request, task: Task): ReactJSONValue {
     task.keyPath, // unlike outlineModel this one carries along context
     task.implicitSlot,
     request.abortableTasks,
-    __DEV__ && enableOwnerStacks ? task.debugOwner : null,
+    __DEV__ ? task.debugOwner : null,
     __DEV__ && enableOwnerStacks ? task.debugStack : null,
     __DEV__ && enableOwnerStacks ? task.debugTask : null,
   );
@@ -1799,8 +1799,8 @@ function createTask(
   >): any);
   if (__DEV__) {
     task.environmentName = request.environmentName();
+    task.debugOwner = debugOwner;
     if (enableOwnerStacks) {
-      task.debugOwner = debugOwner;
       task.debugStack = debugStack;
       task.debugTask = debugTask;
     }
@@ -2167,7 +2167,7 @@ function renderModel(
           task.keyPath,
           task.implicitSlot,
           request.abortableTasks,
-          __DEV__ && enableOwnerStacks ? task.debugOwner : null,
+          __DEV__ ? task.debugOwner : null,
           __DEV__ && enableOwnerStacks ? task.debugStack : null,
           __DEV__ && enableOwnerStacks ? task.debugTask : null,
         );
Repository: electron/electron
Pull request: fix: addChildView() crashes when adding a closed WebContentsView

#### Description of Change

Closes https://github.com/electron/electron/issues/47074

#### Checklist

- [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 `addChildView()` crashes when adding a closed WebContentsView



Changed files:
filename: shell/browser/api/electron_api_view.cc
patch: @@ -216,6 +216,12 @@ void View::AddChildViewAt(gin::Handle<View> child,
   if (!view_)
     return;
 
+  if (!child->view()) {
+    gin_helper::ErrorThrower(isolate()).ThrowError(
+        "Can't add a destroyed child view to a parent view");
+    return;
+  }
+
   // This will CHECK and crash in View::AddChildViewAtImpl if not handled here.
   if (view_ == child->view()) {
     gin_helper::ErrorThrower(isolate()).ThrowError(

filename: spec/api-web-contents-view-spec.ts
patch: @@ -55,6 +55,20 @@ describe('WebContentsView', () => {
     })).to.throw('options.webContents is already attached to a window');
   });
 
+  it('should throw an error when adding a destroyed child view to the parent view', async () => {
+    const browserWindow = new BrowserWindow();
+
+    const webContentsView = new WebContentsView();
+    webContentsView.webContents.loadURL('about:blank');
+    webContentsView.webContents.destroy();
+
+    const destroyed = once(webContentsView.webContents, 'destroyed');
+    await destroyed;
+    expect(() => browserWindow.contentView.addChildView(webContentsView)).to.throw(
+      'Can\'t add a destroyed child view to a parent view'
+    );
+  });
+
   it('should throw error when created with already attached webContents to other WebContentsView', () => {
     const browserWindow = new BrowserWindow();