helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Reset inspected element cache in the event of an error

This prevents React from immediately erroring again when re-rendering (since the previous error would have been stored in the Suspense cache)

Resolves #21819

Changed files:
filename: packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js
patch: @@ -108,8 +108,8 @@ export function InspectedElementContextController({children}: Props) {
   }
 
   // Don't load a stale element from the backend; it wastes bridge bandwidth.
-  let inspectedElement = null;
   let hookNames: HookNames | null = null;
+  let inspectedElement = null;
   if (!elementHasChanged && element !== null) {
     inspectedElement = inspectElement(element, state.path, store, bridge);
 

filename: packages/react-devtools-shared/src/devtools/views/Components/InspectedElementErrorBoundary.js
patch: @@ -8,9 +8,14 @@
  */
 
 import * as React from 'react';
-import {useContext} from 'react';
+import {
+  useCallback,
+  useContext,
+  unstable_useCacheRefresh as useCacheRefresh,
+} from 'react';
 import ErrorBoundary from '../ErrorBoundary';
 import {TreeStateContext} from './TreeContext';
+import {clearCacheBecauseOfError} from '../../../inspectedElementCache';
 import styles from './InspectedElementErrorBoundary.css';
 
 type WrapperProps = {|
@@ -23,9 +28,18 @@ export default function InspectedElementErrorBoundaryWrapper({
   // Key on the selected element ID so that changing the selected element automatically hides the boundary.
   // This seems best since an error inspecting one element isn't likely to be relevant to another element.
   const {selectedElementID} = useContext(TreeStateContext);
+
+  const refresh = useCacheRefresh();
+  const handleDsmiss = useCallback(() => {
+    clearCacheBecauseOfError(refresh);
+  }, [refresh]);
+
   return (
     <div className={styles.Wrapper}>
-      <ErrorBoundary key={selectedElementID} canDismiss={true}>
+      <ErrorBoundary
+        key={selectedElementID}
+        canDismiss={true}
+        onBeforeDismissCallback={handleDsmiss}>
         {children}
       </ErrorBoundary>
     </div>

filename: packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ErrorBoundary.js
patch: @@ -17,6 +17,7 @@ import SuspendingErrorView from './SuspendingErrorView';
 type Props = {|
   children: React$Node,
   canDismiss?: boolean,
+  onBeforeDismissCallback?: () => void,
   store?: Store,
 |};
 
@@ -118,6 +119,11 @@ export default class ErrorBoundary extends Component<Props, State> {
   }
 
   _dismissError = () => {
+    const onBeforeDismissCallback = this.props.onBeforeDismissCallback;
+    if (typeof onBeforeDismissCallback === 'function') {
+      onBeforeDismissCallback();
+    }
+
     this.setState(InitialState);
   };
 

filename: packages/react-devtools-shared/src/inspectedElementCache.js
patch: @@ -190,3 +190,10 @@ export function checkForUpdate({
     );
   }
 }
+
+export function clearCacheBecauseOfError(refresh: RefreshFunction): void {
+  startTransition(() => {
+    const map = createMap();
+    refresh(createMap, map);
+  });
+}
Repository: nodejs/node
Pull request: deps: update corepack to 0.28.2

This is an automated update of corepack to 0.28.2.

Changed files:
filename: deps/corepack/CHANGELOG.md
patch: @@ -1,5 +1,12 @@
 # Changelog
 
+## [0.28.2](https://github.com/nodejs/corepack/compare/v0.28.1...v0.28.2) (2024-05-31)
+
+
+### Features
+
+* update package manager versions ([#481](https://github.com/nodejs/corepack/issues/481)) ([e1abb83](https://github.com/nodejs/corepack/commit/e1abb832416a793b490b2b51b4082fe822fc932c))
+
 ## [0.28.1](https://github.com/nodejs/corepack/compare/v0.28.0...v0.28.1) (2024-05-10)
 
 

filename: deps/corepack/README.md
patch: @@ -247,7 +247,7 @@ same major line. Should you need to upgrade to a new major, use an explicit
   prevent Corepack showing the URL when it needs to download software, or can be
   set to `1` to have the URL shown. By default, when Corepack is called
   explicitly (e.g. `corepack pnpm …`), it is set to `0`; when Corepack is called
-  implicitely (e.g. `pnpm …`), it is set to `1`.
+  implicitly (e.g. `pnpm …`), it is set to `1`.
   When standard input is a TTY and no CI environment is detected, Corepack will
   ask for user input before starting the download.
 
@@ -304,7 +304,8 @@ same major line. Should you need to upgrade to a new major, use an explicit
 
 ### Networking
 
-There are a wide variety of networking issues that can occur while running `corepack` commands. Things to check:
+There are a wide variety of networking issues that can occur while running
+`corepack` commands. Things to check:
 
 - Make sure your network connection is active.
 - Make sure the host for your request can be resolved by your DNS; try using

filename: deps/corepack/package.json
patch: @@ -1,6 +1,6 @@
 {
   "name": "corepack",
-  "version": "0.28.1",
+  "version": "0.28.2",
   "homepage": "https://github.com/nodejs/corepack#readme",
   "bugs": {
     "url": "https://github.com/nodejs/corepack/issues"
Repository: denoland/deno
Pull request: fix: bump deno_core to fix unsoundness

Includes a Rust 1.78.0 fix: https://github.com/denoland/deno_core/pull/735

Fixes deno homebrew crashes:

#23767
#23766
#23763

and https://github.com/Homebrew/homebrew-core/issues/171317


Changed files:
filename: Cargo.lock
patch: @@ -1303,9 +1303,9 @@ dependencies = [
 
 [[package]]
 name = "deno_core"
-version = "0.279.0"
+version = "0.280.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6af4398065fca315c07f07c3a7074fc8928e0a0488eeb16b68f390ab9190ed97"
+checksum = "12d26f2d3e243bbbdd0851ab542b20ec48ac1fcf6c64ab06e81133da3113ebdd"
 dependencies = [
  "anyhow",
  "bincode",
@@ -1764,9 +1764,9 @@ dependencies = [
 
 [[package]]
 name = "deno_ops"
-version = "0.155.0"
+version = "0.156.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5acf7e33e0000df00433e50334d42eb325bd1195d81e3d579d4cb09de601303e"
+checksum = "8237b272db1a6cb941b8a5a63ba63539004a8263e8b0230a11136d76eea273f9"
 dependencies = [
  "proc-macro-rules",
  "proc-macro2",
@@ -5734,9 +5734,9 @@ dependencies = [
 
 [[package]]
 name = "serde_v8"
-version = "0.188.0"
+version = "0.189.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb49d0c52dba872ec78d826009b0cb0ec3b911753bda8b7e98f104cf88e0b936"
+checksum = "893c995255d6fbf55c33166b651fd037c4e3cc7864bf82213ea18d0ec94ed165"
 dependencies = [
  "num-bigint",
  "serde",
@@ -7258,9 +7258,9 @@ dependencies = [
 
 [[package]]
 name = "v8"
-version = "0.91.0"
+version = "0.91.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03bdee44e85d6235cff99e1ed5b1016c53822c70d1cce3d51f421b27a125a1e8"
+checksum = "69026e2e8af55a4d2f20c0c17f690e8b31472bf76ab75b1205d3a0fab60c8f84"
 dependencies = [
  "bitflags 2.5.0",
  "fslock",

filename: Cargo.toml
patch: @@ -44,7 +44,7 @@ repository = "https://github.com/denoland/deno"
 
 [workspace.dependencies]
 deno_ast = { version = "=0.38.1", features = ["transpiling"] }
-deno_core = { version = "0.279.0" }
+deno_core = { version = "0.280.0" }
 
 deno_bench_util = { version = "0.144.0", path = "./bench_util" }
 deno_lockfile = "0.19.0"
Repository: ggml-org/llama.cpp
Pull request: speculative : fix seg fault in certain cases

Fixes a crash when using tree-based speculative decoding with greedy sampling:

```bash
make -j llama-speculative && ./bin/llama-speculative -m ../models/qwen2.5-32b-coder-instruct/ggml-model-q4_0.gguf -md ../models/qwen2.5-0.5b-coder-instruct/ggml-model-q4_0.gguf --ctx-size 0 -ub 4096 -b 4096 -ngl 99 -ngld 99 -fa --draft-max 8 --draft-min 0 --draft-p-min 0.75 -c 4096 --color -p "Write a quicksort algorithm" -np 4 --top-k 1 -s 1
```

Changed files:
filename: examples/speculative/speculative.cpp
patch: @@ -331,11 +331,11 @@ int main(int argc, char ** argv) {
                         }
 
                         active_seqs.erase(s);
-                        for(int i = 0; i < n_seq_dft; i++) {
+                        for (int i = 0; i < n_seq_dft; i++) {
                             if (i == s) {
                                 continue;
                             }
-                            if (drafts[i].tokens[i_dft] == drafts[s].tokens[i_dft]) {
+                            if (drafts[i].active && drafts[i].tokens[i_dft] == drafts[s].tokens[i_dft]) {
                                 // synchronize active status for sequences with the same drafted token
                                 drafts[i].active = drafts[i].active && accept;
                                 if (!drafts[i].active) {
Repository: denoland/deno
Pull request: fix(runtime): Allow opening /dev/fd/XXX for unix

`deno run script.ts <(some command)` is a valid use case -- let's allow this to work without `--allow-all`.

Fixes #23703 

Changed files:
filename: runtime/permissions/lib.rs
patch: @@ -1680,7 +1680,46 @@ impl PermissionsContainer {
       return Ok(());
     }
 
+    /// We'll allow opening /proc/self/fd/{n} without additional permissions under the following conditions:
+    ///
+    /// 1. n > 2. This allows for opening bash-style redirections, but not stdio
+    /// 2. the fd referred to by n is a pipe
+    #[cfg(unix)]
+    fn is_fd_file_is_pipe(path: &Path) -> bool {
+      if let Some(fd) = path.file_name() {
+        if let Ok(s) = std::str::from_utf8(fd.as_encoded_bytes()) {
+          if let Ok(n) = s.parse::<i32>() {
+            if n > 2 {
+              // SAFETY: This is proper use of the stat syscall
+              unsafe {
+                let mut stat = std::mem::zeroed::<libc::stat>();
+                if libc::fstat(n, &mut stat as _) == 0
+                  && ((stat.st_mode & libc::S_IFMT) & libc::S_IFIFO) != 0
+                {
+                  return true;
+                }
+              };
+            }
+          }
+        }
+      }
+      false
+    }
+
+    // On unixy systems, we allow opening /dev/fd/XXX for valid FDs that
+    // are pipes.
+    #[cfg(unix)]
+    if path.starts_with("/dev/fd") && is_fd_file_is_pipe(path) {
+      return Ok(());
+    }
+
     if cfg!(target_os = "linux") {
+      // On Linux, we also allow opening /proc/self/fd/XXX for valid FDs that
+      // are pipes.
+      #[cfg(unix)]
+      if path.starts_with("/proc/self/fd") && is_fd_file_is_pipe(path) {
+        return Ok(());
+      }
       if path.starts_with("/dev")
         || path.starts_with("/proc")
         || path.starts_with("/sys")

filename: tests/specs/permission/proc_self_fd/__test__.jsonc
patch: @@ -0,0 +1,5 @@
+{
+  "args": "run -A main.js",
+  "output": "hi\n\n0\n",
+  "exitCode": 123
+}

filename: tests/specs/permission/proc_self_fd/main.js
patch: @@ -0,0 +1,18 @@
+// This test is Linux/Darwin only
+if (Deno.build.os !== "linux" && Deno.build.os !== "darwin") {
+  console.log("hi\n\n0");
+  Deno.exit(123);
+}
+
+const cmd = new Deno.Command("/usr/bin/env", {
+  args: [
+    "bash",
+    "-c",
+    [Deno.execPath(), "run", "--allow-read", "reader.ts", '<(echo "hi")'].join(
+      " ",
+    ),
+  ],
+}).spawn();
+
+console.log((await cmd.status).code);
+Deno.exit(123);

filename: tests/specs/permission/proc_self_fd/reader.ts
patch: @@ -0,0 +1 @@
+console.log(Deno.readTextFileSync(Deno.args[0]));
Repository: electron/electron
Pull request: fix: crash with creating OffScreenWebContentsView

Backport of #42920

See that PR for details.


Notes: Fixed a potential crash when using off screen rendering.


Changed files:
filename: shell/browser/osr/osr_web_contents_view.h
patch: @@ -110,7 +110,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
   raw_ptr<content::WebContents> web_contents_ = nullptr;
 
 #if BUILDFLAG(IS_MAC)
-  RAW_PTR_EXCLUSION OffScreenView* offScreenView_;
+  RAW_PTR_EXCLUSION OffScreenView* offScreenView_ = nullptr;
 #endif
 };
Repository: huggingface/transformers
Pull request: Pass num_items_in_batch directly to loss computation

# What does this PR do?

Fixes #36744

Models:

- vision models: @amyeroberts, @qubvel



Changed files:
filename: src/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py
patch: @@ -21,7 +21,6 @@
 
 import torch
 from torch import nn
-from torch.nn import CrossEntropyLoss
 
 from ...configuration_utils import PretrainedConfig
 from ...generation import GenerationMixin
@@ -582,6 +581,9 @@ def forward(
         ```"""
         return_dict = return_dict if return_dict is not None else self.config.use_return_dict
 
+        # num_items_in_batch is only needed for loss computation
+        num_items_in_batch = kwargs.pop("num_items_in_batch", None)
+
         kwargs_encoder = {argument: value for argument, value in kwargs.items() if not argument.startswith("decoder_")}
 
         kwargs_decoder = {
@@ -638,8 +640,13 @@ def forward(
         loss = None
         if labels is not None:
             logits = decoder_outputs.logits if return_dict else decoder_outputs[0]
-            loss_fct = CrossEntropyLoss()
-            loss = loss_fct(logits.reshape(-1, self.decoder.config.vocab_size), labels.reshape(-1))
+
+            loss = self.loss_function(
+                logits=logits,
+                labels=labels,
+                vocab_size=self.decoder.config.vocab_size,
+                num_items_in_batch=num_items_in_batch,
+            )
 
         if not return_dict:
             if loss is not None:
Repository: ggml-org/llama.cpp
Pull request: SYCL: Disable f16 Unary OPs as not supported by the kernels

Commit 87abb7e added some F16 tests to Unary OPs. Disabled them in the device OP function.

Will implement and enable those once I finish up some refactoring.


Changed files:
filename: ggml/src/ggml-sycl/ggml-sycl.cpp
patch: @@ -41,6 +41,7 @@
 #include "ggml-sycl/gemm.hpp"
 #include "ggml-sycl/sycl_hw.hpp"
 #include "ggml-sycl/getrows.hpp"
+#include "ggml.h"
 
 static bool g_sycl_loaded = false;
 int g_ggml_sycl_debug = 0;
@@ -3864,7 +3865,7 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
                 case GGML_UNARY_OP_GELU_QUICK:
                 case GGML_UNARY_OP_TANH:
                 case GGML_UNARY_OP_EXP:
-                    return ggml_is_contiguous(op->src[0]);
+                    return ggml_is_contiguous(op->src[0]) && (op->src[0]->type == GGML_TYPE_F32);
                 default:
                     return false;
             }
@@ -3981,23 +3982,24 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
         case GGML_OP_VIEW:
         case GGML_OP_PERMUTE:
         case GGML_OP_TRANSPOSE:
+            return true;
         case GGML_OP_ADD:
         case GGML_OP_ADD1:
-        case GGML_OP_LOG:
         case GGML_OP_SUB:
         case GGML_OP_MUL:
         case GGML_OP_DIV:
-            return true;
-        case GGML_OP_NORM:
-        case GGML_OP_RMS_NORM:
-        case GGML_OP_GROUP_NORM:
-            return ggml_is_contiguous(op->src[0]);
-        case GGML_OP_SCALE:
         case GGML_OP_SQR:
         case GGML_OP_SQRT:
         case GGML_OP_SIN:
         case GGML_OP_COS:
         case GGML_OP_CLAMP:
+        case GGML_OP_LOG:
+            return (op->src[0]->type == GGML_TYPE_F32);
+        case GGML_OP_NORM:
+        case GGML_OP_RMS_NORM:
+        case GGML_OP_GROUP_NORM:
+            return ggml_is_contiguous(op->src[0]);
+        case GGML_OP_SCALE:
             return true;
         case GGML_OP_CONT:
             return op->src[0]->type != GGML_TYPE_BF16;
Repository: facebook/react
Pull request: [SSR2 Fixture] Delete duplicate DOCTYPE

before
![20210708093339](https://user-images.githubusercontent.com/11924426/124849648-bef7c580-dfd1-11eb-9100-c1bb4116d901.jpg)

after
![20210708093705](https://user-images.githubusercontent.com/11924426/124849666-c5863d00-dfd1-11eb-8941-764fbd55337a.jpg)


Changed files:
filename: fixtures/ssr2/server/render.js
patch: @@ -47,7 +47,6 @@ module.exports = function render(url, res) {
         // If something errored before we started streaming, we set the error code appropriately.
         res.statusCode = didError ? 500 : 200;
         res.setHeader('Content-type', 'text/html');
-        res.write('<!DOCTYPE html>');
         startWriting();
       },
       onError(x) {
Repository: facebook/react
Pull request: DevTools show error icon when hook name parsing fails

Resolves #21817

![hooknameerrorbadgeKapture 2021-07-07 at 16 06 08](https://user-images.githubusercontent.com/29597/124821917-45ae9300-df3d-11eb-9f3f-fdec9c187730.gif)


Changed files:
filename: packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js
patch: @@ -26,7 +26,6 @@ import {
   inspectElement,
 } from 'react-devtools-shared/src/inspectedElementCache';
 import {loadHookNames} from 'react-devtools-shared/src/hookNamesCache';
-import {ElementTypeFunction} from 'react-devtools-shared/src/types';
 import LoadHookNamesFunctionContext from 'react-devtools-shared/src/devtools/views/Components/LoadHookNamesFunctionContext';
 import {SettingsContext} from '../Settings/SettingsContext';
 
@@ -112,7 +111,6 @@ export function InspectedElementContextController({children}: Props) {
       if (parseHookNames) {
         if (
           inspectedElement !== null &&
-          inspectedElement.type === ElementTypeFunction &&
           inspectedElement.hooks !== null &&
           loadHookNamesFunction !== null
         ) {

filename: packages/react-devtools-shared/src/devtools/views/Components/InspectedElementHooksTree.css
patch: @@ -81,4 +81,8 @@
 
 .HookName {
   color: var(--color-component-name);
+}
+
+.ToggleError {
+  color: var(--color-error-text);
 }
\ No newline at end of file

filename: packages/react-devtools-shared/src/devtools/views/Components/InspectedElementHooksTree.js
patch: @@ -64,6 +64,17 @@ export function InspectedElementHooksTree({
     toggleParseHookNames();
   };
 
+  const hookParsingFailed = parseHookNames && hookNames === null;
+
+  let toggleTitle;
+  if (hookParsingFailed) {
+    toggleTitle = 'Hook parsing failed';
+  } else if (parseHookNames) {
+    toggleTitle = 'Parsing hook names ...';
+  } else {
+    toggleTitle = 'Parse hook names (may be slow)';
+  }
+
   const handleCopy = () => copy(serializeHooksForCopy(hooks));
 
   if (hooks === null) {
@@ -73,16 +84,13 @@ export function InspectedElementHooksTree({
       <div className={styles.HooksTreeView}>
         <div className={styles.HeaderRow}>
           <div className={styles.Header}>hooks</div>
-          {enableHookNameParsing && !parseHookNames && (
+          {enableHookNameParsing && (!parseHookNames || hookParsingFailed) && (
             <Toggle
+              className={hookParsingFailed ? styles.ToggleError : null}
               isChecked={parseHookNamesOptimistic}
-              isDisabled={parseHookNamesOptimistic}
+              isDisabled={parseHookNamesOptimistic || hookParsingFailed}
               onChange={handleChange}
-              title={
-                parseHookNames
-                  ? 'Parse hook names'
-                  : 'Parse hook names (may be slow)'
-              }>
+              title={toggleTitle}>
               <ButtonIcon type="parse-hook-names" />
             </Toggle>
           )}
Repository: facebook/react
Pull request: DevTools named hooks: Support FLow syntax

Detect Flow pragma (@flow) and use Flow plug-in instead of TypeScript (default)

Resolves #21793

Changed files:
filename: packages/react-devtools-extensions/src/parseHookNames.js
patch: @@ -542,10 +542,15 @@ async function parseSourceAST(
       hookSourceData.originalSourceAST = sourceMetadata.originalSourceAST;
       hookSourceData.originalSourceCode = sourceMetadata.originalSourceCode;
     } else {
+      // TypeScript is the most commonly used typed JS variant so let's default to it
+      // unless we detect explicit Flow usage via the "@flow" pragma.
+      const plugin =
+        originalSourceCode.indexOf('@flow') > 0 ? 'flow' : 'typescript';
+
       // TODO (named hooks) Parsing should ideally be done off of the main thread.
       const originalSourceAST = parse(originalSourceCode, {
         sourceType: 'unambiguous',
-        plugins: ['jsx', 'typescript'],
+        plugins: ['jsx', plugin],
       });
       hookSourceData.originalSourceAST = originalSourceAST;
       if (__DEBUG__) {
Repository: ggml-org/llama.cpp
Pull request: context : always use non-causal attention for encoder graphs

ref https://github.com/ggml-org/llama.cpp/pull/12181#issuecomment-2730864028

Changed files:
filename: src/llama-context.cpp
patch: @@ -1057,13 +1057,22 @@ int llama_context::encode(llama_batch & inp_batch) {
     ggml_backend_sched_reset(sched.get());
     ggml_backend_sched_set_eval_callback(sched.get(), cparams.cb_eval, cparams.cb_eval_user_data);
 
+    const auto causal_attn_org = cparams.causal_attn;
+
+    // always use non-causal attention for encoder graphs
+    // TODO: this is a tmp solution until we have a proper way to support enc-dec models
+    //       ref: https://github.com/ggml-org/llama.cpp/pull/12181#issuecomment-2730451223
+    cparams.causal_attn = false;
+
     auto * gf = graph_init();
     auto res = graph_build(ctx_compute.get(), gf, ubatch, LLM_GRAPH_TYPE_ENCODER);
 
     ggml_backend_sched_alloc_graph(sched.get(), gf);
 
     res->set_inputs(&ubatch);
 
+    cparams.causal_attn = causal_attn_org;
+
     const auto compute_status = graph_compute(gf, n_tokens > 1);
     switch (compute_status) {
         case GGML_STATUS_SUCCESS: