helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: fix: correct bounds check in XCDA array access

In the constructor of `llm_tokenizer_ugm`, `xcda_array` is an array with `xcda_array_size` elements:

https://github.com/ggml-org/llama.cpp/blob/017eceed61e885b79f6cf3542e0879be68c6e922/src/llama-vocab.cpp#L776-L777

The valid index range is `[0, xcda_array_size)`.

When `xcda_array_view` is constructed using these parameters:

https://github.com/ggml-org/llama.cpp/blob/017eceed61e885b79f6cf3542e0879be68c6e922/src/llama-vocab.cpp#L1048

The accessible index range remains `[0, xcda_array_size)`.

Therefore, in the `xcda_array_view::get_node` function, it should use `>=` to check for bounds violation instead of `>`.


Changed files:
filename: src/llama-vocab.cpp
patch: @@ -1013,7 +1013,7 @@ struct llm_tokenizer_ugm_session {
         }
     private:
         uint32_t get_node(size_t index) {
-            if (index > xcda_array_size) {
+            if (index >= xcda_array_size) {
                 throw std::runtime_error("Index out of array bounds in XCDA array!");
             }
             return xcda_array[index];
Repository: ollama/ollama
Pull request: fix: restore modelfile system in prompt template

In #1244 this line which sets the modelfile system variable in the template got removed. It must still be there to apply the system template from the modelfile. 

Changed files:
filename: server/images.go
patch: @@ -64,6 +64,11 @@ func (m *Model) Prompt(p PromptVars) (string, error) {
 		return "", err
 	}
 
+	if p.System == "" {
+		// use the default system prompt for this model if one is not specified
+		p.System = m.System
+	}
+
 	vars := map[string]any{
 		"System":   p.System,
 		"Prompt":   p.Prompt,
Repository: vercel/next.js
Pull request: update `.node-version` to v20

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to understand the PR)
- When linking to a Slack thread, you might want to share details of the conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Changed files:
filename: .node-version
patch: @@ -1 +1 @@
-v18
+v20
Repository: facebook/react
Pull request: [React Compiler] Fix rule name for ESLint plugin

/cc @poteto

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

<!--
 Explain the **motivation** for making this change. What existing problem does the pull request solve?
-->

Seems like the README of the package was outdated.

## How did you test this change?

Tried this configuration in a project of mine.

<!--
  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: compiler/packages/eslint-plugin-react-compiler/README.md
patch: @@ -34,7 +34,7 @@ Then configure the rules you want to use under the rules section.
 ```json
 {
     "rules": {
-        "react-compiler/rule-name": 2
+        "react-compiler/react-compiler": "error"
     }
 }
 ```
Repository: electron/electron
Pull request: fix: missing `HandleScope` in `RemoveFromParentChildWindows`

#### Description of Change

Closes https://github.com/electron/electron/issues/46752.

Adds missing `v8::HandleScope` to `BaseWindow::RemoveFromParentChildWindows`.

#### 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: Fixes a potential crash when closing a window with child windows.

Changed files:
filename: shell/browser/api/electron_api_base_window.cc
patch: @@ -1161,8 +1161,10 @@ void BaseWindow::RemoveFromParentChildWindows() {
   if (parent_window_.IsEmpty())
     return;
 
+  v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
+  v8::HandleScope handle_scope(isolate);
   gin::Handle<BaseWindow> parent;
-  if (!gin::ConvertFromV8(isolate(), GetParentWindow(), &parent) ||
+  if (!gin::ConvertFromV8(isolate, GetParentWindow(), &parent) ||
       parent.IsEmpty()) {
     return;
   }
Repository: nodejs/node
Pull request: doc: update `git node release` example

And add additional info for security releases.

<!--
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/contributing/releases.md
patch: @@ -735,15 +735,34 @@ the build before moving forward. Use the following list as a baseline:
 ### 11. Tag and sign the release commit
 
 Once you have produced builds that you're happy with you can either run
-`git node release --promote`
+`git node release --promote`:
 
 ```bash
-git node release -S --promote https://github.com/nodejs/node/pull/XXXX
+git node release --promote https://github.com/nodejs/node/pull/XXXX -S
 ```
 
 to automate the remaining steps until step 16 or you can perform it manually
 following the below steps.
 
+<details>
+<summary>Security release</summary>
+
+For security releases, NCU should be configured to target the public repository,
+not the private one where the proposal are hosted. Pass the upstream where to
+fetch the proposal from using the `--fetch-from` flag.
+
+When promoting several releases, you can pass multiple URLs:
+
+```bash
+git node release --promote \
+  --fetch-from git@github.com:nodejs-private/node-private.git \
+  https://github.com/nodejs-private/node-private/pull/XXXX \
+  https://github.com/nodejs-private/node-private/pull/XXXX \
+  -S
+```
+
+</details>
+
 ***
 
 Create a new tag: By waiting until this stage to create tags, you can discard
Repository: electron/electron
Pull request: fix: missing `HandleScope` in `RemoveFromParentChildWindows`

Backport of #46758

See that PR for details.


Notes: Fixes a potential crash when closing a window with child windows.

Changed files:
filename: shell/browser/api/electron_api_base_window.cc
patch: @@ -1163,8 +1163,10 @@ void BaseWindow::RemoveFromParentChildWindows() {
   if (parent_window_.IsEmpty())
     return;
 
+  v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
+  v8::HandleScope handle_scope(isolate);
   gin::Handle<BaseWindow> parent;
-  if (!gin::ConvertFromV8(isolate(), GetParentWindow(), &parent) ||
+  if (!gin::ConvertFromV8(isolate, GetParentWindow(), &parent) ||
       parent.IsEmpty()) {
     return;
   }
Repository: facebook/react
Pull request: [React Compiler] use `filename` instead of `context.filename` in ESLint plugin

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

Use `filename` instead of `context.filename` in eslint compiler.

The problem is that in `react-native` + `typescript` project the context may not have `filename`:

<img width="384" alt="image" src="https://github.com/facebook/react/assets/22820318/e5d184fa-5ac9-4512-96b9-644baa3d5f25">

And eslint will crash with:

```bash
TypeError: Error while loading rule 'react-compiler/react-compiler': Cannot read properties of undefined (reading 'endsWith')
```

But in fact we already derive `filename` variable earlier so we can simply reuse the variable (I guess).

## How did you test this change?

- add `eslint` plugin to RN project;
- run eslint


Changed files:
filename: compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts
patch: @@ -114,10 +114,7 @@ const rule: Rule.RuleModule = {
     }
 
     let babelAST;
-    if (
-      context.filename.endsWith(".tsx") ||
-      context.filename.endsWith(".ts")
-    ) {
+    if (filename.endsWith(".tsx") || filename.endsWith(".ts")) {
       try {
         const { parse: babelParse } = require("@babel/parser");
         babelAST = babelParse(sourceCode, {
Repository: ggml-org/llama.cpp
Pull request: CUDA: static assert to prevent misuse of memcpy_1

Adds a static assert to prevent the use of `ggml_cuda_memcpy_1` in a way that's not intended. The problem is that the purpose of the function is to do properly coalesced and aligned copies, if copies larger than the maximum amount of bytes per instruction are allowed that will complicate making possible changes in the future.

Changed files:
filename: ggml/src/ggml-cuda/common.cuh
patch: @@ -586,6 +586,12 @@ static __device__ __forceinline__ void ggml_cuda_mad(half2 & acc, const half2 v,
 //     If dst and src point at different address spaces then they are guaranteed to not be aliased.
 template <int nbytes, int alignment = 0>
 static __device__ __forceinline__ void ggml_cuda_memcpy_1(void * __restrict__ dst, const void * __restrict__ src) {
+    static_assert(
+        nbytes <= ggml_cuda_get_max_cpy_bytes() || alignment == 0,
+        "You are misusing the alignment parameter for ggml_cuda_memcpy_1. "
+        "The intent is for the parameter is only as a workaround if either one of the pointers is not properly aligned. "
+        "If you use it to do more bytes per copy than ggml_cuda_max_cpy_bytes() the reads and writes may not be coalesced. "
+        "Call ggml_cuda_memcpy_1 in a loop instead.");
     if constexpr (alignment != 0) {
         static_assert(nbytes % alignment == 0, "bad alignment");
     }
Repository: facebook/react
Pull request: [compiler:publish] Specify https for registry

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

Uses https for the npm registry so the publishing script isn't rejected.
Fixes:

```
Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
```

Changed files:
filename: compiler/scripts/publish.js
patch: @@ -203,7 +203,7 @@ async function main() {
       try {
         await spawnHelper(
           "npm",
-          [...opts, "--registry=http://registry.npmjs.org"],
+          [...opts, "--registry=https://registry.npmjs.org"],
           {
             cwd: pkgDir,
             stdio: "inherit",
Repository: huggingface/transformers
Pull request: Fix self.dropout_p is not defined for SamAttention/Sam2Attention

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/40255#issuecomment-3247886994

`self.dropout_p` shouldn't be used for SamAttention/Sam2Attention, only for RoPE attention (memory attention) in Sam2Video

Changed files:
filename: src/transformers/models/sam/modeling_sam.py
patch: @@ -262,7 +262,7 @@ def forward(
             key,
             value,
             attention_mask=attention_similarity,
-            dropout=0.0 if not self.training else self.dropout_p,
+            dropout=0.0,
             scaling=self.scaling,
             is_causal=self.is_causal,
             **kwargs,

filename: src/transformers/models/sam2/modeling_sam2.py
patch: @@ -893,7 +893,7 @@ def forward(
             key,
             value,
             attention_mask=attention_similarity,
-            dropout=0.0 if not self.training else self.dropout_p,
+            dropout=0.0,
             scaling=self.scaling,
             is_causal=self.is_causal,
             **kwargs,

filename: src/transformers/models/sam2/modular_sam2.py
patch: @@ -940,7 +940,7 @@ def forward(
             key,
             value,
             attention_mask=attention_similarity,
-            dropout=0.0 if not self.training else self.dropout_p,
+            dropout=0.0,
             scaling=self.scaling,
             is_causal=self.is_causal,
             **kwargs,

filename: src/transformers/models/sam2_video/modeling_sam2_video.py
patch: @@ -478,7 +478,7 @@ def forward(
             key,
             value,
             attention_mask=attention_similarity,
-            dropout=0.0 if not self.training else self.dropout_p,
+            dropout=0.0,
             scaling=self.scaling,
             is_causal=self.is_causal,
             **kwargs,

filename: src/transformers/models/sam_hq/modeling_sam_hq.py
patch: @@ -674,7 +674,7 @@ def forward(
             key,
             value,
             attention_mask=attention_similarity,
-            dropout=0.0 if not self.training else self.dropout_p,
+            dropout=0.0,
             scaling=self.scaling,
             is_causal=self.is_causal,
             **kwargs,
Repository: denoland/deno
Pull request: ci: use windows-2022 image for 'promote_to_release' workflow

Also changes code-signing step to not cache dependencies, which should fix the 
problem with Azure Codesigning returning error because of missing deps.

Changed files:
filename: .github/workflows/promote_to_release.yml
patch: @@ -18,7 +18,7 @@ jobs:
   # Handle Windows binary patching and re-signing in a separate job
   promote-to-release-windows:
     name: Promote Windows to Release
-    runs-on: windows-latest
+    runs-on: windows-2022
     if: github.repository == 'denoland/deno'
     permissions:
       contents: write
@@ -30,7 +30,7 @@ jobs:
         uses: actions/checkout@v4
         with:
           token: ${{ secrets.DENOBOT_PAT }}
-          submodules: recursive
+          submodules: false
 
       - name: Install deno
         uses: denoland/setup-deno@v2
@@ -60,6 +60,8 @@ jobs:
       - name: Code sign deno.exe
         uses: azure/trusted-signing-action@v0
         with:
+          cache-dependencies: false
+          trace: true
           endpoint: https://eus.codesigning.azure.net/
           trusted-signing-account-name: deno-cli-code-signing
           certificate-profile-name: deno-cli-code-signing-cert
Repository: ggml-org/llama.cpp
Pull request: ggml : use std::sort in ggml_argsort CPU implementation

Use `std::sort` in `ggml_compute_forward_argsort_f32()` instead of bubble sort.

Changed files:
filename: ggml/src/ggml-cpu/ops.cpp
patch: @@ -7,8 +7,9 @@
 #include "unary-ops.h"
 #include "vec.h"
 
-#include <float.h>
+#include <cfloat>
 #include <algorithm>
+#include <functional>
 
 // ggml_compute_forward_dup
 
@@ -7682,24 +7683,24 @@ static void ggml_compute_forward_argsort_f32(
     ggml_sort_order order = (ggml_sort_order) ggml_get_op_params_i32(dst, 0);
 
     for (int64_t i = ith; i < nr; i += nth) {
-        int32_t * dst_data = (int32_t *)((char *) dst->data + i*nb1);
         const float * src_data = (float *)((char *) src0->data + i*nb01);
 
+        int32_t * dst_data = (int32_t *)((char *) dst->data + i*nb1);
+
         for (int64_t j = 0; j < ne0; j++) {
             dst_data[j] = j;
         }
 
-        // C doesn't have a functional sort, so we do a bubble sort instead
-        for (int64_t j = 0; j < ne0; j++) {
-            for (int64_t k = j + 1; k < ne0; k++) {
-                if ((order == GGML_SORT_ORDER_ASC  && src_data[dst_data[j]] > src_data[dst_data[k]]) ||
-                    (order == GGML_SORT_ORDER_DESC && src_data[dst_data[j]] < src_data[dst_data[k]])) {
-                    int32_t tmp = dst_data[j];
-                    dst_data[j] = dst_data[k];
-                    dst_data[k] = tmp;
-                }
-            }
+        std::function<bool(int32_t, int32_t)> cmp;
+
+        // note: this might be causing memory allocations? ideally should be avoided if it's the case
+        switch (order) {
+            case GGML_SORT_ORDER_ASC:  cmp = [src_data](int32_t a, int32_t b) { return src_data[a] < src_data[b]; }; break;
+            case GGML_SORT_ORDER_DESC: cmp = [src_data](int32_t a, int32_t b) { return src_data[a] > src_data[b]; }; break;
+            default: GGML_ABORT("invalid sort order");
         }
+
+        std::sort(dst_data, dst_data + ne0, cmp);
     }
 }
Repository: vercel/next.js
Pull request: Tests: Don't use next/dist for test/e2e/streaming-ssr

## What?

This test incorrectly using internals instead of the public api. Switched it to using the custom server api.

Closes PACK-5401

Changed files:
filename: test/e2e/streaming-ssr/custom-server/server.js
patch: @@ -1,43 +1,31 @@
-const NextServer = require('next/dist/server/next-server').default
-const defaultNextConfig =
-  require('next/dist/server/config-shared').defaultConfig
+const next = require('next')
 const http = require('http')
 
-process.on('SIGTERM', () => process.exit(0))
-process.on('SIGINT', () => process.exit(0))
+const port = parseInt(process.env.PORT, 10) || 3000
+const dev = process.env.NODE_ENV !== 'production'
 
-let handler
+const app = next({ dev })
 
-const server = http.createServer(async (req, res) => {
-  try {
-    await handler(req, res)
-  } catch (err) {
-    console.error(err)
-    res.statusCode = 500
-    res.end('Internal Server Error')
-  }
-})
-const currentPort = parseInt(process.env.PORT, 10) || 3000
+process.on('SIGTERM', () => process.exit(0))
+process.on('SIGINT', () => process.exit(0))
 
-server.listen(currentPort, (err) => {
-  if (err) {
-    console.error('Failed to start server', err)
-    process.exit(1)
-  }
-  const nextServer = new NextServer({
-    hostname: 'localhost',
-    port: currentPort,
-    customServer: true,
-    dev: false,
-    conf: {
-      ...defaultNextConfig,
-      distDir: '.next',
-      experimental: {
-        ...defaultNextConfig.experimental,
-      },
-    },
+app.prepare().then(() => {
+  const handler = app.getRequestHandler()
+  const server = http.createServer(async (req, res) => {
+    try {
+      await handler(req, res)
+    } catch (err) {
+      console.error(err)
+      res.statusCode = 500
+      res.end('Internal Server Error')
+    }
   })
-  handler = nextServer.getRequestHandler()
 
-  console.log('Listening on port', currentPort)
+  server.listen(port, (err) => {
+    if (err) {
+      console.error('Failed to start server', err)
+      process.exit(1)
+    }
+    console.log('Listening on port', port)
+  })
 })