helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: `performance-no-automatic-move` clang-tidy warnings

Backport of #44742

See that PR for details.


Notes: none

Changed files:
filename: shell/browser/extensions/electron_extensions_browser_client.cc
patch: @@ -174,7 +174,7 @@ base::FilePath ElectronExtensionsBrowserClient::GetBundleResourcePath(
   if (!chrome_resources_path.IsParent(extension_resources_path))
     return base::FilePath();
 
-  const base::FilePath request_relative_path =
+  base::FilePath request_relative_path =
       extensions::file_util::ExtensionURLToRelativeFilePath(request.url);
   if (!ExtensionsBrowserClient::Get()
            ->GetComponentExtensionResourceManager()

filename: shell/common/logging.cc
patch: @@ -29,16 +29,13 @@ base::FilePath GetLogFileName(const base::CommandLine& command_line) {
   if (!filename.empty())
     return base::FilePath::FromUTF8Unsafe(filename);
 
-  const base::FilePath log_filename(FILE_PATH_LITERAL("electron_debug.log"));
-  base::FilePath log_path;
+  auto log_filename = base::FilePath{FILE_PATH_LITERAL("electron_debug.log")};
 
-  if (base::PathService::Get(chrome::DIR_LOGS, &log_path)) {
-    log_path = log_path.Append(log_filename);
-    return log_path;
-  } else {
-    // error with path service, just use some default file somewhere
-    return log_filename;
-  }
+  if (base::FilePath path; base::PathService::Get(chrome::DIR_LOGS, &path))
+    return path.Append(log_filename);
+
+  // error with path service, just use some default file somewhere
+  return log_filename;
 }
 
 namespace {
Repository: denoland/deno
Pull request: fix(kv): improve backoff error message and inline documentation

Ref: #27536


Changed files:
filename: cli/tsc/dts/lib.deno.unstable.d.ts
patch: @@ -293,7 +293,8 @@ declare namespace Deno {
    * executions. Each element in the array represents the number of milliseconds
    * to wait before retrying the execution. For example, `[1000, 5000, 10000]`
    * means that a failed execution will be retried at most 3 times, with 1
-   * second, 5 seconds, and 10 seconds delay between each retry.
+   * second, 5 seconds, and 10 seconds delay between each retry. There is a
+   * limit of 5 retries and a maximum interval of 1 hour (3600000 milliseconds).
    *
    * @category Cloud
    * @experimental

filename: ext/kv/01_db.ts
patch: @@ -77,15 +77,19 @@ const maxQueueBackoffInterval = 60 * 60 * 1000;
 
 function validateBackoffSchedule(backoffSchedule: number[]) {
   if (backoffSchedule.length > maxQueueBackoffIntervals) {
-    throw new TypeError("Invalid backoffSchedule");
+    throw new TypeError(
+      `Invalid backoffSchedule, max ${maxQueueBackoffIntervals} intervals allowed`,
+    );
   }
   for (let i = 0; i < backoffSchedule.length; ++i) {
     const interval = backoffSchedule[i];
     if (
       interval < 0 || interval > maxQueueBackoffInterval ||
       NumberIsNaN(interval)
     ) {
-      throw new TypeError("Invalid backoffSchedule");
+      throw new TypeError(
+        `Invalid backoffSchedule, interval at index ${i} is invalid`,
+      );
     }
   }
 }

filename: tests/unit/kv_test.ts
patch: @@ -1951,14 +1951,14 @@ dbTest("Invalid backoffSchedule", async (db) => {
       await db.enqueue("foo", { backoffSchedule: [1, 1, 1, 1, 1, 1] });
     },
     TypeError,
-    "Invalid backoffSchedule",
+    "Invalid backoffSchedule, max 5 intervals allowed",
   );
   await assertRejects(
     async () => {
       await db.enqueue("foo", { backoffSchedule: [3600001] });
     },
     TypeError,
-    "Invalid backoffSchedule",
+    "Invalid backoffSchedule, interval at index 0 is invalid",
   );
 });
Repository: ggml-org/llama.cpp
Pull request: server: enable token array inputs for OAI API

According to the [OpenAI documentation](https://platform.openai.com/docs/api-reference/completions/create#completions_create-prompt) formatting the prompt as an array of tokens is supported. However, the llama.cpp server raises an error if you provide such input. I assume the reason is that the interpretation of tokens depends on the model so this would not be "OpenAI compatible" either way. However, I have a use case where I need such inputs. This PR simply removes the error in the llama.cpp server. I don't think this would cause issues but my understanding of the server code is also relatively poor.

I'm currently working on benchmarking llama.cpp vs. vllm. Both projects provide an OAI-compatible API. So I want to make `scripts/server-bench.py` use the OAI-compatible API instead of the llama.cpp-specific API in order to use the exact same code for benchmarking either project. Under these circumstances I want to be able to send prompts of an exact length (in tokens) while at the same time the interpretations of those prompts as text are irrelevant.

 

Changed files:
filename: tools/server/server.cpp
patch: @@ -4249,9 +4249,6 @@ int main(int argc, char ** argv) {
 
             // process prompt
             std::vector<server_tokens> inputs;
-            if (oaicompat && !prompt.is_string()) {
-                throw std::runtime_error("prompt must be a string");
-            }
 
             if (oaicompat && has_mtmd) {
                 // multimodal
Repository: denoland/deno
Pull request: fix(check): line-break between diagnostic message chain entries

Fixes #27411.

Changed files:
filename: cli/tsc/diagnostics.rs
patch: @@ -90,9 +90,9 @@ impl DiagnosticMessageChain {
     s.push_str(&" ".repeat(level * 2));
     s.push_str(&self.message_text);
     if let Some(next) = &self.next {
-      s.push('\n');
       let arr = next.clone();
       for dm in arr {
+        s.push('\n');
         s.push_str(&dm.format_message(level + 1));
       }
     }

filename: tests/specs/check/message_chain_formatting/__test__.jsonc
patch: @@ -0,0 +1,6 @@
+// Regression test for https://github.com/denoland/deno/issues/27411.
+{
+  "args": "check --quiet message_chain_formatting.ts",
+  "output": "message_chain_formatting.out",
+  "exitCode": 1
+}

filename: tests/specs/check/message_chain_formatting/message_chain_formatting.out
patch: @@ -0,0 +1,10 @@
+error: TS2769 [ERROR]: No overload matches this call.
+  Overload 1 of 3, '(s: string, b: boolean): void', gave the following error.
+    Argument of type 'number' is not assignable to parameter of type 'boolean'.
+  Overload 2 of 3, '(ss: string[], b: boolean): void', gave the following error.
+    Argument of type 'string' is not assignable to parameter of type 'string[]'.
+  Overload 3 of 3, '(ss: string[], b: Date): void', gave the following error.
+    Argument of type 'string' is not assignable to parameter of type 'string[]'.
+foo("hello", 42);
+~~~
+    at [WILDLINE]/message_chain_formatting.ts:8:1

filename: tests/specs/check/message_chain_formatting/message_chain_formatting.ts
patch: @@ -0,0 +1,8 @@
+function foo(s: string, b: boolean): void;
+function foo(ss: string[], b: boolean): void;
+function foo(ss: string[], b: Date): void;
+function foo(sOrSs: string | string[], b: boolean | Date): void {
+  console.log(sOrSs, b);
+}
+
+foo("hello", 42);
Repository: facebook/react
Pull request: Remove internal `act` from DevTools e2e test

For various reasons some of the DevTools e2e tests uses our repo's private internal version of `act`. It should really just be using the public one.

This converts one of the usages, because it was causing CI to fail.

Changed files:
filename: packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js
patch: @@ -17,10 +17,9 @@ describe('Store component filters', () => {
   let legacyRender;
   let store: Store;
   let utils;
-  let internalAct;
 
   const act = async (callback: Function) => {
-    await internalAct(callback);
+    await React.unstable_act(callback);
     jest.runAllTimers(); // Flush Bridge operations
   };
 
@@ -34,7 +33,6 @@ describe('Store component filters', () => {
     React = require('react');
     Types = require('react-devtools-shared/src/types');
     utils = require('./utils');
-    internalAct = require('internal-test-utils').act;
 
     legacyRender = utils.legacyRender;
   });
Repository: electron/electron
Pull request: fix: `performance-no-automatic-move` clang-tidy warnings

Backport of #44742

See that PR for details.


Notes: none

Changed files:
filename: shell/browser/extensions/electron_extensions_browser_client.cc
patch: @@ -177,7 +177,7 @@ base::FilePath ElectronExtensionsBrowserClient::GetBundleResourcePath(
   if (!chrome_resources_path.IsParent(extension_resources_path))
     return base::FilePath();
 
-  const base::FilePath request_relative_path =
+  base::FilePath request_relative_path =
       extensions::file_util::ExtensionURLToRelativeFilePath(request.url);
   if (!ExtensionsBrowserClient::Get()
            ->GetComponentExtensionResourceManager()

filename: shell/common/logging.cc
patch: @@ -29,16 +29,13 @@ base::FilePath GetLogFileName(const base::CommandLine& command_line) {
   if (!filename.empty())
     return base::FilePath::FromUTF8Unsafe(filename);
 
-  const base::FilePath log_filename(FILE_PATH_LITERAL("electron_debug.log"));
-  base::FilePath log_path;
+  auto log_filename = base::FilePath{FILE_PATH_LITERAL("electron_debug.log")};
 
-  if (base::PathService::Get(chrome::DIR_LOGS, &log_path)) {
-    log_path = log_path.Append(log_filename);
-    return log_path;
-  } else {
-    // error with path service, just use some default file somewhere
-    return log_filename;
-  }
+  if (base::FilePath path; base::PathService::Get(chrome::DIR_LOGS, &path))
+    return path.Append(log_filename);
+
+  // error with path service, just use some default file somewhere
+  return log_filename;
 }
 
 namespace {
Repository: nodejs/node
Pull request: doc: make first parameter optional in `util.getCallSites`

`frameCount` is optional because its default value is 10. And change parameter name from `frameCountOrOptions` to `frameCount` because it's described as `frameCount` in below description.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/util.md
patch: @@ -450,7 +450,7 @@ util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
 // when printed to a terminal.
 ```
 
-## `util.getCallSites(frameCountOrOptions, [options])`
+## `util.getCallSites([frameCount][, options])`
 
 <!-- YAML
 added: v22.9.0
Repository: facebook/react
Pull request: Remote `.internal` override from untrusted URL tests

Adding `.internal` to a test file prevents it from being tested in build mode. The best practice is to instead gate the test based on whether the feature is enabled.

Ideally we'd use the `@gate` pragma in these tests, but the `itRenders` test helpers don't support that.

Changed files:
filename: packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.js
patch: @@ -149,6 +149,13 @@ function runTests(itRenders, itRejectsRendering, expectToReject) {
 }
 
 describe('ReactDOMServerIntegration - Untrusted URLs', () => {
+  // The `itRenders` helpers don't work with the gate pragma, so we have to do
+  // this instead.
+  if (gate(flags => flags.disableJavaScriptURLs)) {
+    it("empty test so Jest doesn't complain", () => {});
+    return;
+  }
+
   function initModules() {
     jest.resetModules();
     React = require('react');
@@ -181,6 +188,13 @@ describe('ReactDOMServerIntegration - Untrusted URLs', () => {
 });
 
 describe('ReactDOMServerIntegration - Untrusted URLs - disableJavaScriptURLs', () => {
+  // The `itRenders` helpers don't work with the gate pragma, so we have to do
+  // this instead.
+  if (gate(flags => !flags.disableJavaScriptURLs)) {
+    it("empty test so Jest doesn't complain", () => {});
+    return;
+  }
+
   function initModules() {
     jest.resetModules();
     const ReactFeatureFlags = require('shared/ReactFeatureFlags');

filename: scripts/jest/setupTests.www.js
patch: @@ -6,16 +6,7 @@ jest.mock('shared/ReactFeatureFlags', () => {
     () => jest.requireActual('shared/forks/ReactFeatureFlags.www-dynamic'),
     {virtual: true}
   );
-
-  const wwwFlags = jest.requireActual('shared/forks/ReactFeatureFlags.www');
-  const defaultFlags = jest.requireActual('shared/ReactFeatureFlags');
-
-  // TODO: Many tests were written before we started running them against the
-  // www configuration. Update those tests so that they work against the www
-  // configuration, too. Then remove these overrides.
-  wwwFlags.disableJavaScriptURLs = defaultFlags.disableJavaScriptURLs;
-
-  return wwwFlags;
+  return jest.requireActual('shared/forks/ReactFeatureFlags.www');
 });
 
 jest.mock('scheduler/src/SchedulerFeatureFlags', () => {
Repository: denoland/deno
Pull request: fix(npm): deterministically output tags to initialized file

The tags were being sorted in a random order due to the package_reqs hashmap

Changed files:
filename: cli/npm/managed/resolvers/local.rs
patch: @@ -7,6 +7,7 @@ use std::cell::RefCell;
 use std::cmp::Ordering;
 use std::collections::hash_map::Entry;
 use std::collections::BTreeMap;
+use std::collections::BTreeSet;
 use std::collections::HashMap;
 use std::collections::HashSet;
 use std::fs;
@@ -369,10 +370,10 @@ async fn sync_resolution_with_fs(
     );
   let packages_with_deprecation_warnings = Arc::new(Mutex::new(Vec::new()));
 
-  let mut package_tags: HashMap<&PackageNv, Vec<&str>> = HashMap::new();
+  let mut package_tags: HashMap<&PackageNv, BTreeSet<&str>> = HashMap::new();
   for (package_req, package_nv) in snapshot.package_reqs() {
     if let Some(tag) = package_req.version_req.tag() {
-      package_tags.entry(package_nv).or_default().push(tag);
+      package_tags.entry(package_nv).or_default().insert(tag);
     }
   }
 
@@ -392,7 +393,17 @@ async fn sync_resolution_with_fs(
     let folder_path = deno_local_registry_dir.join(&package_folder_name);
     let tags = package_tags
       .get(&package.id.nv)
-      .map(|tags| tags.join(","))
+      .map(|tags| {
+        capacity_builder::StringBuilder::<String>::build(|builder| {
+          for (i, tag) in tags.iter().enumerate() {
+            if i > 0 {
+              builder.append(',')
+            }
+            builder.append(*tag);
+          }
+        })
+        .unwrap()
+      })
       .unwrap_or_default();
     enum PackageFolderState {
       UpToDate,
Repository: electron/electron
Pull request: test: run script to help target discovery and reduce flakes

Backport of #44741

See that PR for details.


Notes: none

Changed files:
filename: spec/api-debugger-spec.ts
patch: @@ -227,20 +227,25 @@ describe('debugger module', () => {
     it('creates unique session id for each target', (done) => {
       w.webContents.loadFile(path.join(__dirname, 'fixtures', 'sub-frames', 'debug-frames.html'));
       w.webContents.debugger.attach();
-      let session: String;
+      let debuggerSessionId: string;
 
       w.webContents.debugger.on('message', (event, ...args) => {
         const [method, params, sessionId] = args;
         if (method === 'Target.targetCreated') {
           w.webContents.debugger.sendCommand('Target.attachToTarget', { targetId: params.targetInfo.targetId, flatten: true }).then(result => {
-            session = result.sessionId;
+            debuggerSessionId = result.sessionId;
             w.webContents.debugger.sendCommand('Debugger.enable', {}, result.sessionId);
+
+            // Ensure debugger finds a script to pause to possibly reduce flaky
+            // tests.
+            w.webContents.mainFrame.executeJavaScript('void 0;');
           });
         }
         if (method === 'Debugger.scriptParsed') {
-          expect(sessionId).to.equal(session);
-          w.webContents.debugger.detach();
-          done();
+          if (sessionId === debuggerSessionId) {
+            w.webContents.debugger.detach();
+            done();
+          }
         }
       });
       w.webContents.debugger.sendCommand('Target.setDiscoverTargets', { discover: true });
Repository: ggml-org/llama.cpp
Pull request: CUDA: fix MMQ nwarps for AMD with warp_size==32

It seems that in https://github.com/ggml-org/llama.cpp/pull/14624 the number of warps for AMD was accidentally changed from 8 to 4 for all warp sizes. As a consequence for AMD GPUs with a warp size of 32 the performance has gotten worse since the kernel is only using half the threads. This PR makes it so that a constant number of 256 threads is used and that those threads are either spread across 4 or 8 warps depending on warp size.

Changed files:
filename: ggml/src/ggml-cuda/mmq.cuh
patch: @@ -251,25 +251,21 @@ static constexpr __device__ int mmq_get_granularity_device(const int /*mmq_x*/)
 #endif // AMD_MFMA_AVAILABLE
 
 #if defined(GGML_USE_HIP)
-static int mmq_get_nwarps_host(const int cc) {
-    return amd_mfma_available(cc) ? 8 : 4;
+static int mmq_get_nwarps_host(const int cc, const int warp_size) {
+    return amd_mfma_available(cc) ? 8 : 256/warp_size;
 }
 #else
-static int mmq_get_nwarps_host(const int /*cc*/) {
-    return 8;
+static int mmq_get_nwarps_host(const int /*cc*/, const int warp_size) {
+    return 256/warp_size;
 }
 #endif // (GGML_USE_HIP)
 
 static constexpr __device__ int mmq_get_nwarps_device() {
-#if defined(GGML_USE_HIP)
 #if defined(AMD_MFMA_AVAILABLE)
     return 8;
 #else
-    return 4;
+    return 256/ggml_cuda_get_physical_warp_size();
 #endif // AMD_MFMA_AVAILABLE
-#else
-    return 8;
-#endif // defined(GGML_USE_HIP)
 }
 
 // ------------------------------------------------------------
@@ -3472,7 +3468,7 @@ static void launch_mul_mat_q(ggml_backend_cuda_context & ctx, const mmq_args & a
     const int cc = ggml_cuda_info().devices[id].cc;
     const int nsm = ggml_cuda_info().devices[id].nsm;
     const int warp_size = ggml_cuda_info().devices[id].warp_size;
-    const int nwarps = mmq_get_nwarps_host(cc);
+    const int nwarps = mmq_get_nwarps_host(cc, warp_size);
     const int mmq_y = get_mmq_y_host(cc);
 
     const dim3 block_dims(warp_size, nwarps, 1);
@@ -3559,7 +3555,7 @@ void mul_mat_q_case(ggml_backend_cuda_context & ctx, const mmq_args & args, cuda
     const int    cc     = ggml_cuda_info().devices[id].cc;
     const size_t smpbo  = ggml_cuda_info().devices[id].smpbo;
     const int warp_size = ggml_cuda_info().devices[id].warp_size;
-    const int nwarps    = mmq_get_nwarps_host(cc);
+    const int nwarps    = mmq_get_nwarps_host(cc, warp_size);
 
     const int mmq_x_max = get_mmq_x_max_host(cc);
     const int mmq_y = get_mmq_y_host(cc);
Repository: facebook/react
Pull request: [Flight Fixture] Fix proxying with compression

We're decompressing and then writing and recompressing in the proxy. This causes it to stall if buffered because `.pipe()` doesn't force flush automatically.

Changed files:
filename: fixtures/flight/server/global.js
patch: @@ -157,7 +157,13 @@ app.all('/', async function (req, res, next) {
       const rscResponse = await promiseForData;
       // For other request, we pass-through the RSC payload.
       res.set('Content-type', 'text/x-component');
-      rscResponse.pipe(res);
+      rscResponse.on('data', data => {
+        res.write(data);
+        res.flush();
+      });
+      rscResponse.on('end', data => {
+        res.end();
+      });
     } catch (e) {
       console.error(`Failed to proxy request: ${e.stack}`);
       res.statusCode = 500;
Repository: nodejs/node
Pull request: doc: fix usage of module.registerSync in comment

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->
The method `module.registerSync` does not exist and the comment refers to `module.registerHooks`.

Changed files:
filename: doc/api/module.md
patch: @@ -1226,7 +1226,7 @@ opt-in to using the non-default behavior:
 import { readFile } from 'node:fs/promises';
 
 // Asynchronous version accepted by module.register(). This fix is not needed
-// for the synchronous version accepted by module.registerSync().
+// for the synchronous version accepted by module.registerHooks().
 export async function load(url, context, nextLoad) {
   const result = await nextLoad(url, context);
   if (result.format === 'commonjs') {