helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: doc: update --max-semi-space-size description in cli.md

<!--
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.
-->
Fixes #55487 

Changed files:
filename: doc/api/cli.md
patch: @@ -3541,8 +3541,12 @@ an increase of 1 MiB to semi-space applies to each of the three individual
 semi-spaces and causes the heap size to increase by 3 MiB. The throughput
 improvement depends on your workload (see [#42511][]).
 
-The default value is 16 MiB for 64-bit systems and 8 MiB for 32-bit systems. To
-get the best configuration for your application, you should try different
+The default value depends on the memory limit. For example, on 64-bit systems
+with a memory limit of 512 MiB, the max size of a semi-space defaults to 1 MiB.
+On 64-bit systems with a memory limit of 2 GiB, the max size of a semi-space
+defaults to 16 MiB.
+
+To get the best configuration for your application, you should try different
 max-semi-space-size values when running benchmarks for your application.
 
 For example, benchmark on a 64-bit systems:
Repository: electron/electron
Pull request: fix: dangling raw_ptr NodeBindings::uv_env_

Backport of #42933

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/electron_browser_main_parts.cc
patch: @@ -602,6 +602,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
   node_env_->set_trace_sync_io(false);
   js_env_->DestroyMicrotasksRunner();
   node::Stop(node_env_.get(), node::StopFlags::kDoNotTerminateIsolate);
+  node_bindings_->set_uv_env(nullptr);
   node_env_.reset();
 
   auto default_context_key = ElectronBrowserContext::PartitionKey("", false);

filename: shell/browser/electron_browser_main_parts.h
patch: @@ -155,10 +155,10 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
   // Before then, we just exit() without any intermediate steps.
   std::optional<int> exit_code_;
 
-  std::unique_ptr<NodeBindings> node_bindings_;
+  const std::unique_ptr<NodeBindings> node_bindings_;
 
   // depends-on: node_bindings_
-  std::unique_ptr<ElectronBindings> electron_bindings_;
+  const std::unique_ptr<ElectronBindings> electron_bindings_;
 
   // depends-on: node_bindings_
   std::unique_ptr<JavascriptEnvironment> js_env_;
Repository: vercel/next.js
Pull request: Revert "fix: make sure body can be read using `nodejs` runtime in middleware"

Reverts vercel/next.js#77553

Closes #77646

Changed files:
filename: packages/next/src/server/next-server.ts
patch: @@ -1626,12 +1626,7 @@ export default class NextNodeServer extends BaseServer<
 
       result = await adapterFn({
         handler: middlewareModule.middleware || middlewareModule,
-        request: {
-          ...requestData,
-          body: !['HEAD', 'GET'].includes(params.request.method)
-            ? requestData.body?.cloneBodyStream()
-            : undefined,
-        },
+        request: requestData,
         page: 'middleware',
       })
     } else {

filename: test/e2e/middleware-general/app/middleware-node.js
patch: @@ -253,10 +253,6 @@ export async function middleware(request) {
     throw new Error('test error')
   }
 
-  if (url.pathname === '/request-body' && request.method === 'POST') {
-    return NextResponse.json(await request.json())
-  }
-
   const original = new URL(request.url)
   return NextResponse.next({
     headers: {

filename: test/e2e/middleware-general/app/middleware.js
patch: @@ -252,10 +252,6 @@ export async function middleware(request) {
     throw new Error('test error')
   }
 
-  if (url.pathname === '/request-body' && request.method === 'POST') {
-    return NextResponse.json(await request.json())
-  }
-
   const original = new URL(request.url)
   return NextResponse.next({
     headers: {

filename: test/e2e/middleware-general/test/index.test.ts
patch: @@ -824,17 +824,6 @@ describe('Middleware Runtime', () => {
         }/sha.json?hello=goodbye`,
       ])
     })
-
-    it(`should read request body`, async () => {
-      const body = { hello: 'world' }
-      const res = await fetchViaHTTP(next.url, '/request-body', undefined, {
-        body: JSON.stringify(body),
-        headers: { 'content-type': 'application/json' },
-        method: 'POST',
-      })
-
-      expect(await res.json()).toEqual(body)
-    })
   }
   describe('with i18n', () => {
     setup({ i18n: true })
Repository: denoland/deno
Pull request: fix(node): wrong `worker_threads.terminate()` return value

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->

Fixes https://github.com/denoland/deno/issues/23801

Changed files:
filename: ext/node/polyfills/worker_threads.ts
patch: @@ -32,6 +32,7 @@ import process from "node:process";
 const { JSONParse, JSONStringify, ObjectPrototypeIsPrototypeOf } = primordials;
 const {
   Error,
+  PromiseResolve,
   Symbol,
   SymbolFor,
   SymbolIterator,
@@ -280,7 +281,8 @@ class NodeWorker extends EventEmitter {
       this.#status = "TERMINATED";
       op_host_terminate_worker(this.#id);
     }
-    this.emit("exit", 1);
+    this.emit("exit", 0);
+    return PromiseResolve(0);
   }
 
   ref() {

filename: tests/unit_node/worker_threads_test.ts
patch: @@ -516,6 +516,32 @@ Deno.test({
   },
 });
 
+Deno.test({
+  name: "[node/worker_threads] Returns terminate promise with exit code",
+  async fn() {
+    const deferred = Promise.withResolvers<void>();
+    const worker = new workerThreads.Worker(
+      `
+      import { parentPort } from "node:worker_threads";
+      parentPort.postMessage("ok");
+      `,
+      {
+        eval: true,
+      },
+    );
+
+    worker.on("message", (data) => {
+      assertEquals(data, "ok");
+      deferred.resolve();
+    });
+
+    await deferred.promise;
+    const promise = worker.terminate();
+    assertEquals(typeof promise.then, "function");
+    assertEquals(await promise, 0);
+  },
+});
+
 Deno.test({
   name:
     "[node/worker_threads] MessagePort.on all message listeners are invoked",
Repository: nodejs/node
Pull request: src: nuke deprecated and un-used enum members in `OptionEnvvarSettings`

Delete deprecated an never used enum options `kAllowedInEnvironment` and `kDisallowedInEnvironment` in `OptionEnvvarSettings`

-------
I'm not too sure if this is gonna be ok in CITGM, but, lets give it a try!

Changed files:
filename: src/node.h
patch: @@ -374,10 +374,6 @@ enum OptionEnvvarSettings {
   // Disallow the options to be set via the environment variable, like
   // `NODE_OPTIONS`.
   kDisallowedInEnvvar = 1,
-  // Deprecated, use kAllowedInEnvvar instead.
-  kAllowedInEnvironment = kAllowedInEnvvar,
-  // Deprecated, use kDisallowedInEnvvar instead.
-  kDisallowedInEnvironment = kDisallowedInEnvvar,
 };
 
 // Process the arguments and set up the per-process options.

filename: typings/internalBinding/options.d.ts
patch: @@ -17,8 +17,8 @@ export interface OptionsBinding {
     aliases: Map<string, string[]>;
   };
   envSettings: {
-    kAllowedInEnvironment: 0;
-    kDisallowedInEnvironment: 1;
+    kAllowedInEnvvar: 0;
+    kDisallowedInEnvvar: 1;
   };
   noGlobalSearchPaths: boolean;
   shouldNotRegisterESMLoader: boolean;
Repository: ggml-org/llama.cpp
Pull request: Add assertion informing the API user about missing llama_encode() call

Using encoder-decoder models like T5 without calling `llama_encode()` first currently results in a cryptic error message:

```GGML_ASSERT: ggml/src/ggml.c:5278: !ggml_is_transposed(a)```

that is already causing confusion: #8398.

This PR adds an assertion to `build_t5()` that informs the API user about the necessity of calling `llama_encode()` first if there are no encoder outputs present during `llama_decode()`. With this PR the error message is:

```GGML_ASSERT: src/llama.cpp:13203: n_outputs_enc > 0 && "call llama_encode() first"```

- [x] I have read the [contributing guidelines](https://github.com/ggerganov/llama.cpp/blob/master/CONTRIBUTING.md)
- Self-reported review complexity:
  - [x] Low
  - [ ] Medium
  - [ ] High


Changed files:
filename: src/llama.cpp
patch: @@ -13200,6 +13200,8 @@ struct llm_build_context {
                     LLM_NORM_RMS, cb, -1);
             cb(cur, "result_norm", -1);
         } else {
+            GGML_ASSERT(n_outputs_enc > 0 && "call llama_encode() first");
+
             struct ggml_tensor * embd_enc       = llm_build_inp_embd_enc();
             struct ggml_tensor * pos_bucket_dec = llm_build_pos_bucket(true);
Repository: vercel/next.js
Pull request: pack-next: use default `--js-build` as option instead of `--no-js-build`

Yargs automatically creates `--no-` variations of options. Using `--no-js-build` as an option directly confuses it.

`--no-js-build` remains a valid cli argument.

Test Plan: Verify `pnpm pack-next` builds JS by default and `pnpm pack-next --no-js-build` doesn’t.

Help now looks like this:

```
pack-next.ts

Options:
      --help      Show help                                            [boolean]
      --version   Show version number                                  [boolean]
      --js-build  Build JavaScript code (default). Use `--no-js-build` to skip
                  building JavaScript                  [boolean] [default: true]
  -p, --project                                                         [string]
      --tar       Create tarballs instead of direct reflinks           [boolean]
      --compress  How compress the binary, useful on platforms where tarballs
                  can exceed 2 GiB, which causes ERR_FS_FILE_TOO_LARGE with
                  pnpm. Defaults to "strip" on Linux, otherwise defaults to
                  "none". Requires `--tar` to be set.
                                             [string] [choices: "none", "strip"]
```


Closes PACK-4242

Changed files:
filename: scripts/pack-next.ts
patch: @@ -33,9 +33,11 @@ interface CliOptions {
 
 const cliOptions = yargs(process.argv.slice(2))
   .command('$0')
-  .option('no-js-build', {
+  .option('js-build', {
     type: 'boolean',
-    describe: 'Skip building JavaScript code',
+    default: true,
+    describe:
+      'Build JavaScript code (default). Use `--no-js-build` to skip building JavaScript',
   })
   .option('project', {
     alias: 'p',
Repository: electron/electron
Pull request: fix: ensure showInactive actually shows

This aligns our API usage with Chromium and ensures that windows shown inactive that were initially hidden actually get painted to.

Notes: Fixed issue where windows made visible with `showInactive` were blank

Changed files:
filename: shell/browser/native_window_mac.mm
patch: @@ -473,7 +473,7 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) {
   if (parent())
     InternalSetParentWindow(parent(), true);
 
-  [window_ orderFrontRegardless];
+  [window_ orderFrontKeepWindowKeyState];
 }
 
 void NativeWindowMac::Hide() {
Repository: ggml-org/llama.cpp
Pull request: Run CI on Github-hosted arm64 runners too

This PR enables CI on Github-hosted arm64 runners that are now [available for free](https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/) in public repositories

Related to #11275 

Changed files:
filename: .github/workflows/build.yml
patch: @@ -173,7 +173,10 @@ jobs:
           name: llama-bin-macos-x64.zip
 
   ubuntu-cpu-cmake:
-    runs-on: ubuntu-22.04
+    strategy:
+      matrix:
+        os: [ubuntu-22.04, ubuntu-22.04-arm]
+    runs-on: ${{ matrix.os }}
 
     steps:
       - name: Clone
Repository: vercel/next.js
Pull request: Scripts: migrate unpack-next to TypeScript

## Convert unpack-next.cjs to TypeScript

### What?
Converted `scripts/unpack-next.cjs` to TypeScript, renaming it to `scripts/unpack-next.ts` and updating the imports and type definitions.

### Why?
This change continues the ongoing TypeScript migration efforts in the codebase, providing better type safety and developer experience.

### How?
- Renamed file from `.cjs` to `.ts`
- Converted CommonJS `require()` statements to ES module `import` statements
- Added type annotation for the `path` parameter in the `realPathIfAny` function

Fixes #

Closes PACK-4244

Changed files:
filename: scripts/unpack-next.ts
patch: @@ -1,14 +1,14 @@
 // This script must be run with tsx
 
-const { NEXT_DIR, exec } = require('./pack-util')
-const fs = require('fs')
-const path = require('path')
+import { NEXT_DIR, exec } from './pack-util'
+import fs from 'fs'
+import path from 'path'
 
 const TARBALLS = `${NEXT_DIR}/tarballs`
 
 const PROJECT_DIR = path.resolve(process.argv[2])
 
-function realPathIfAny(path) {
+function realPathIfAny(path: fs.PathLike) {
   try {
     return fs.realpathSync(path)
   } catch {
Repository: electron/electron
Pull request: fix: dangling raw_ptr<Session> in UserDataLink 

Manual backport of #42786 to 30-x-y. See that PR for details.

Notes: none.

Changed files:
filename: shell/browser/api/electron_api_session.cc
patch: @@ -327,9 +327,10 @@ class DictionaryObserver final : public SpellcheckCustomDictionary::Observer {
 #endif  // BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
 
 struct UserDataLink : base::SupportsUserData::Data {
-  explicit UserDataLink(Session* ses) : session(ses) {}
+  explicit UserDataLink(base::WeakPtr<Session> session_in)
+      : session{std::move(session_in)} {}
 
-  raw_ptr<Session> session;
+  base::WeakPtr<Session> session;
 };
 
 const void* kElectronApiSessionKey = &kElectronApiSessionKey;
@@ -349,8 +350,9 @@ Session::Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context)
 
   protocol_.Reset(isolate, Protocol::Create(isolate, browser_context).ToV8());
 
-  browser_context->SetUserData(kElectronApiSessionKey,
-                               std::make_unique<UserDataLink>(this));
+  browser_context->SetUserData(
+      kElectronApiSessionKey,
+      std::make_unique<UserDataLink>(weak_factory_.GetWeakPtr()));
 
 #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
   SpellcheckService* service =
@@ -1226,7 +1228,7 @@ bool Session::IsSpellCheckerEnabled() const {
 Session* Session::FromBrowserContext(content::BrowserContext* context) {
   auto* data =
       static_cast<UserDataLink*>(context->GetUserData(kElectronApiSessionKey));
-  return data ? data->session : nullptr;
+  return data ? data->session.get() : nullptr;
 }
 
 // static

filename: shell/browser/api/electron_api_session.h
patch: @@ -10,6 +10,7 @@
 #include <vector>
 
 #include "base/memory/raw_ptr.h"
+#include "base/memory/weak_ptr.h"
 #include "base/values.h"
 #include "content/public/browser/download_manager.h"
 #include "electron/buildflags/buildflags.h"
@@ -213,7 +214,9 @@ class Session : public gin::Wrappable<Session>,
   // The client id to enable the network throttler.
   base::UnguessableToken network_emulation_token_;
 
-  raw_ptr<ElectronBrowserContext> browser_context_;
+  const raw_ptr<ElectronBrowserContext> browser_context_;
+
+  base::WeakPtrFactory<Session> weak_factory_{this};
 };
 
 }  // namespace api
Repository: facebook/react
Pull request: Add comment support to `@gate` pragma

So you can more easily comment on why a test is gated.

Changed files:
filename: scripts/babel/__tests__/transform-test-gate-pragma-test.js
patch: @@ -160,6 +160,11 @@ describe('transform-test-gate-pragma', () => {
   test('single quoted strings', () => {
     expect(shouldPass).toBe(true);
   });
+
+  // @gate flagThatIsOn // This is a comment
+  test('line comment', () => {
+    expect(shouldPass).toBe(true);
+  });
 });
 
 describe('transform test-gate-pragma: actual runtime', () => {

filename: scripts/babel/transform-test-gate-pragma.js
patch: @@ -93,6 +93,10 @@ function transform(babel) {
           tokens.push({type: next2});
           i += 2;
           continue;
+        case '//':
+          // This is the beginning of a line comment. The rest of the line
+          // is ignored.
+          return tokens;
       }
 
       switch (char) {
Repository: ggml-org/llama.cpp
Pull request: llama : add support for EXAONE tied word embeddings

Fix https://github.com/ggml-org/llama.cpp/issues/12448

Tested and confirm to work with https://huggingface.co/LGAI-EXAONE/EXAONE-Deep-2.4B


Changed files:
filename: src/llama-model.cpp
patch: @@ -3264,7 +3264,12 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
 
                     // output
                     output_norm = create_tensor(tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd}, 0);
-                    output      = create_tensor(tn(LLM_TENSOR_OUTPUT,      "weight"), {n_embd, n_vocab}, 0);
+                    output      = create_tensor(tn(LLM_TENSOR_OUTPUT,      "weight"), {n_embd, n_vocab}, TENSOR_NOT_REQUIRED);
+
+                    // if output is NULL, init from the input tok embed
+                    if (output == NULL) {
+                        output = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, TENSOR_DUPLICATED);
+                    }
 
                     for (int i = 0; i < n_layer; ++i) {
                         auto & layer = layers[i];
Repository: denoland/deno
Pull request: fix(node): stub `AsyncResource.emitDestroy()`

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->

Fixes https://github.com/denoland/deno/issues/23397

Changed files:
filename: ext/node/polyfills/async_hooks.ts
patch: @@ -207,6 +207,8 @@ export class AsyncResource {
     }
   }
 
+  emitDestroy() {}
+
   bind(fn: (...args: unknown[]) => unknown, thisArg = this) {
     validateFunction(fn, "fn");
     const frame = AsyncContextFrame.current();

filename: tests/unit_node/async_hooks_test.ts
patch: @@ -130,3 +130,8 @@ Deno.test(function asyncResourceStub() {
   const resource = new AsyncResource("dbquery");
   assert(typeof resource.asyncId() === "number");
 });
+
+Deno.test(function emitDestroyStub() {
+  const resource = new AsyncResource("foo");
+  assert(typeof resource.emitDestroy === "function");
+});
Repository: ggml-org/llama.cpp
Pull request: llama-tts : avoid crashes related to bad model file paths

llama--tts crashes when the user provides bad cmdline model paths. In these cases the pointer check prevents both the sigsev and useless runtime.


Changed files:
filename: examples/tts/tts.cpp
patch: @@ -571,6 +571,10 @@ int main(int argc, char ** argv) {
     model_ttc = llama_init_ttc.model.get();
     ctx_ttc   = llama_init_ttc.context.get();
 
+    if (model_ttc == nullptr || ctx_ttc == nullptr) {
+        return ENOENT;
+    }
+
     const llama_vocab * vocab = llama_model_get_vocab(model_ttc);
 
     // TODO: refactor in a common struct
@@ -586,6 +590,10 @@ int main(int argc, char ** argv) {
     model_cts = llama_init_cts.model.get();
     ctx_cts   = llama_init_cts.context.get();
 
+    if (model_cts == nullptr || ctx_cts == nullptr) {
+        return ENOENT;
+    }
+
     std::vector<common_sampler *> smpl(n_parallel);
     for (int i = 0; i < n_parallel; ++i) {
         params.sampling.no_perf = (i != 0);