helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: -Wunsafe-buffer-usage warnings in asar file IO

Backport of #43624

See that PR for details.


Notes: none.

Changed files:
filename: shell/common/asar/archive.cc
patch: @@ -201,39 +201,34 @@ bool Archive::Init() {
     return false;
   }
 
-  std::vector<char> buf;
-  int len;
+  std::vector<uint8_t> buf;
 
   buf.resize(8);
   {
     electron::ScopedAllowBlockingForElectron allow_blocking;
-    len = file_.ReadAtCurrentPos(buf.data(), buf.size());
-  }
-  if (len != static_cast<int>(buf.size())) {
-    PLOG(ERROR) << "Failed to read header size from " << path_.value();
-    return false;
+    if (!file_.ReadAtCurrentPosAndCheck(buf)) {
+      PLOG(ERROR) << "Failed to read header size from " << path_.value();
+      return false;
+    }
   }
 
   uint32_t size;
-  if (!base::PickleIterator(base::Pickle::WithData(base::as_byte_span(buf)))
-           .ReadUInt32(&size)) {
+  if (!base::PickleIterator(base::Pickle::WithData(buf)).ReadUInt32(&size)) {
     LOG(ERROR) << "Failed to parse header size from " << path_.value();
     return false;
   }
 
   buf.resize(size);
   {
     electron::ScopedAllowBlockingForElectron allow_blocking;
-    len = file_.ReadAtCurrentPos(buf.data(), buf.size());
-  }
-  if (len != static_cast<int>(buf.size())) {
-    PLOG(ERROR) << "Failed to read header from " << path_.value();
-    return false;
+    if (!file_.ReadAtCurrentPosAndCheck(buf)) {
+      PLOG(ERROR) << "Failed to read header from " << path_.value();
+      return false;
+    }
   }
 
   std::string header;
-  if (!base::PickleIterator(base::Pickle::WithData(base::as_byte_span(buf)))
-           .ReadString(&header)) {
+  if (!base::PickleIterator(base::Pickle::WithData(buf)).ReadString(&header)) {
     LOG(ERROR) << "Failed to parse header from " << path_.value();
     return false;
   }

filename: shell/common/asar/scoped_temporary_file.cc
patch: @@ -63,20 +63,15 @@ bool ScopedTemporaryFile::InitFromFile(
     return false;
 
   electron::ScopedAllowBlockingForElectron allow_blocking;
-  std::vector<char> buf(size);
-  int len = src->Read(offset, buf.data(), buf.size());
-  if (len != static_cast<int>(size))
+  std::vector<uint8_t> buf(size);
+  if (!src->ReadAndCheck(offset, buf))
     return false;
 
   if (integrity)
-    ValidateIntegrityOrDie(base::as_byte_span(buf), *integrity);
+    ValidateIntegrityOrDie(buf, *integrity);
 
   base::File dest(path_, base::File::FLAG_OPEN | base::File::FLAG_WRITE);
-  if (!dest.IsValid())
-    return false;
-
-  return dest.WriteAtCurrentPos(buf.data(), buf.size()) ==
-         static_cast<int>(size);
+  return dest.IsValid() && dest.WriteAtCurrentPosAndCheck(buf);
 }
 
 }  // namespace asar
Repository: denoland/deno
Pull request: fix(add): better error message providing scoped pkg missing leading `@` symbol

* https://github.com/denoland/deno_semver/pull/30

Changed files:
filename: Cargo.lock
patch: @@ -1967,9 +1967,9 @@ dependencies = [
 
 [[package]]
 name = "deno_semver"
-version = "0.5.9"
+version = "0.5.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fb7520ac21cb236c6f8cc81964e8bf22c72fc58c7b5f762f99b9a95abfe3212"
+checksum = "56feaf035e29320d11adf89eafa14f5447d3089deb1ce7de61ba7969195f5ff1"
 dependencies = [
  "monch",
  "once_cell",

filename: cli/Cargo.toml
patch: @@ -75,7 +75,7 @@ deno_lockfile.workspace = true
 deno_npm = "=0.21.4"
 deno_package_json.workspace = true
 deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] }
-deno_semver = "=0.5.9"
+deno_semver = "=0.5.10"
 deno_task_shell = "=0.17.0"
 deno_terminal.workspace = true
 eszip = "=0.73.0"
Repository: ggml-org/llama.cpp
Pull request: server : (webui) fix a very small misalignment

Fix a very very small misalignment that visually trigger people with OCD

<img width="543" alt="image" src="https://github.com/user-attachments/assets/6cd9ecc6-b73a-42b7-851e-8de2985c4573" />

After:

<img width="460" alt="image" src="https://github.com/user-attachments/assets/38757892-0768-42d7-b506-04b30c359430" />




Changed files:
filename: tools/server/webui/src/components/Sidebar.tsx
patch: @@ -7,6 +7,7 @@ import {
   ArrowDownTrayIcon,
   EllipsisVerticalIcon,
   PencilIcon,
+  PencilSquareIcon,
   TrashIcon,
   XMarkIcon,
 } from '@heroicons/react/24/outline';
@@ -76,15 +77,19 @@ export default function Sidebar() {
             })}
             onClick={() => navigate('/')}
           >
-            + New conversation
+            <PencilSquareIcon className="w-5 h-5" />
+            New conversation
           </div>
 
           {/* list of conversations */}
-          {groupedConv.map((group) => (
-            <div>
+          {groupedConv.map((group, i) => (
+            <div key={i}>
               {/* group name (by date) */}
               {group.title ? (
-                <b className="block text-xs px-2 mb-2 mt-6">{group.title}</b>
+                // we use btn class here to make sure that the padding/margin are aligned with the other items
+                <b className="btn btn-ghost btn-xs bg-none btn-disabled block text-xs text-base-content text-start px-2 mb-0 mt-6 font-bold">
+                  {group.title}
+                </b>
               ) : (
                 <div className="h-2" />
               )}
Repository: nodejs/node
Pull request: src: fix outdated js2c.cc references

<!--
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: src/node_builtins.h
patch: @@ -71,7 +71,7 @@ using BuiltinSourceMap = std::map<std::string, UnionBytes>;
 using BuiltinCodeCacheMap =
     std::unordered_map<std::string, BuiltinCodeCacheData>;
 
-// Generated by tools/js2c.py as node_javascript.cc
+// Generated by tools/js2c.cc as node_javascript.cc
 void RegisterExternalReferencesForInternalizedBuiltinCode(
     ExternalReferenceRegistry* registry);
 
@@ -134,7 +134,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
   // Only allow access from friends.
   friend class CodeCacheBuilder;
 
-  // Generated by tools/js2c.py as node_javascript.cc
+  // Generated by tools/js2c.cc as node_javascript.cc
   void LoadJavaScriptSource();  // Loads data into source_
   UnionBytes GetConfig();       // Return data for config.gypi
Repository: vercel/next.js
Pull request: [ts-next-plugin] update log for utils

Improve the log for debugging when getting possibly undefined values.

Changed files:
filename: packages/next/src/server/typescript/utils.ts
patch: @@ -35,11 +35,33 @@ export function getInfo() {
 }
 
 export function getTypeChecker() {
-  return info.languageService.getProgram()?.getTypeChecker()
+  const program = info.languageService.getProgram()
+  if (!program) {
+    log('Failed to get program while while running getTypeChecker.')
+    return
+  }
+  const typeChecker = program.getTypeChecker()
+  if (!typeChecker) {
+    log('Failed to get type checker while running getTypeChecker.')
+    return
+  }
+  return typeChecker
 }
 
 export function getSource(fileName: string) {
-  return info.languageService.getProgram()?.getSourceFile(fileName)
+  const program = info.languageService.getProgram()
+  if (!program) {
+    log('Failed to get program while running getSource for: ' + fileName)
+    return
+  }
+
+  const sourceFile = program.getSourceFile(fileName)
+  if (!sourceFile) {
+    log('Failed to get source file while running getSource for: ' + fileName)
+    return
+  }
+
+  return sourceFile
 }
 
 export function removeStringQuotes(str: string): string {
Repository: electron/electron
Pull request: fix: -Wunsafe-buffer-usage warnings in asar file IO

Backport of #43624

See that PR for details.


Notes: none.

Changed files:
filename: shell/common/asar/archive.cc
patch: @@ -201,39 +201,34 @@ bool Archive::Init() {
     return false;
   }
 
-  std::vector<char> buf;
-  int len;
+  std::vector<uint8_t> buf;
 
   buf.resize(8);
   {
     electron::ScopedAllowBlockingForElectron allow_blocking;
-    len = file_.ReadAtCurrentPos(buf.data(), buf.size());
-  }
-  if (len != static_cast<int>(buf.size())) {
-    PLOG(ERROR) << "Failed to read header size from " << path_.value();
-    return false;
+    if (!file_.ReadAtCurrentPosAndCheck(buf)) {
+      PLOG(ERROR) << "Failed to read header size from " << path_.value();
+      return false;
+    }
   }
 
   uint32_t size;
-  if (!base::PickleIterator(base::Pickle::WithData(base::as_byte_span(buf)))
-           .ReadUInt32(&size)) {
+  if (!base::PickleIterator(base::Pickle::WithData(buf)).ReadUInt32(&size)) {
     LOG(ERROR) << "Failed to parse header size from " << path_.value();
     return false;
   }
 
   buf.resize(size);
   {
     electron::ScopedAllowBlockingForElectron allow_blocking;
-    len = file_.ReadAtCurrentPos(buf.data(), buf.size());
-  }
-  if (len != static_cast<int>(buf.size())) {
-    PLOG(ERROR) << "Failed to read header from " << path_.value();
-    return false;
+    if (!file_.ReadAtCurrentPosAndCheck(buf)) {
+      PLOG(ERROR) << "Failed to read header from " << path_.value();
+      return false;
+    }
   }
 
   std::string header;
-  if (!base::PickleIterator(base::Pickle::WithData(base::as_byte_span(buf)))
-           .ReadString(&header)) {
+  if (!base::PickleIterator(base::Pickle::WithData(buf)).ReadString(&header)) {
     LOG(ERROR) << "Failed to parse header from " << path_.value();
     return false;
   }

filename: shell/common/asar/scoped_temporary_file.cc
patch: @@ -62,20 +62,15 @@ bool ScopedTemporaryFile::InitFromFile(
     return false;
 
   electron::ScopedAllowBlockingForElectron allow_blocking;
-  std::vector<char> buf(size);
-  int len = src->Read(offset, buf.data(), buf.size());
-  if (len != static_cast<int>(size))
+  std::vector<uint8_t> buf(size);
+  if (!src->ReadAndCheck(offset, buf))
     return false;
 
   if (integrity)
-    ValidateIntegrityOrDie(base::as_byte_span(buf), *integrity);
+    ValidateIntegrityOrDie(buf, *integrity);
 
   base::File dest(path_, base::File::FLAG_OPEN | base::File::FLAG_WRITE);
-  if (!dest.IsValid())
-    return false;
-
-  return dest.WriteAtCurrentPos(buf.data(), buf.size()) ==
-         static_cast<int>(size);
+  return dest.IsValid() && dest.WriteAtCurrentPosAndCheck(buf);
 }
 
 }  // namespace asar
Repository: huggingface/transformers
Pull request: enable test_offloaded_cache_implementation test case on XPU

78 cases passed, 1 case(tests/models/dbrx/test_modeling_dbrx.py::DbrxModelTest::test_offloaded_cache_implementation_0_offloaded
) failed, will fix the 1 failed case in a separate PR. 



Changed files:
filename: tests/generation/test_utils.py
patch: @@ -1947,7 +1947,7 @@ def test_generate_continue_from_inputs_embeds(self):
                     )
 
     @parameterized.expand([("offloaded",)])  # ("offloaded_static",) TODO: @raushan fixme in some models (eg T5)
-    @require_torch_gpu
+    @require_torch_accelerator
     @pytest.mark.generate
     def test_offloaded_cache_implementation(self, cache_implementation):
         """Tests we can generate by indicating `cache_implementation` for each possible cache class"""
Repository: facebook/react
Pull request: Remove ./src/* export from public build

We only export the source directory so Jest and Rollup can access them during local development and at build time. The files don't exist in the public builds, so we don't need the export entry, either.

Changed files:
filename: scripts/rollup/packaging.js
patch: @@ -152,6 +152,7 @@ function filterOutEntrypoints(name) {
   let jsonPath = `build/node_modules/${name}/package.json`;
   let packageJSON = JSON.parse(readFileSync(jsonPath));
   let files = packageJSON.files;
+  let exportsJSON = packageJSON.exports;
   if (!Array.isArray(files)) {
     throw new Error('expected all package.json files to contain a files field');
   }
@@ -181,7 +182,6 @@ function filterOutEntrypoints(name) {
       unlinkSync(`build/node_modules/${name}/${filename}`);
       changed = true;
       // Remove it from the exports field too if it exists.
-      const exportsJSON = packageJSON.exports;
       if (exportsJSON) {
         if (filename === 'index.js') {
           delete exportsJSON['.'];
@@ -190,6 +190,15 @@ function filterOutEntrypoints(name) {
         }
       }
     }
+
+    // We only export the source directory so Jest and Rollup can access them
+    // during local development and at build time. The files don't exist in the
+    // public builds, so we don't need the export entry, either.
+    const sourceWildcardExport = './src/*';
+    if (exportsJSON && exportsJSON[sourceWildcardExport]) {
+      delete exportsJSON[sourceWildcardExport];
+      changed = true;
+    }
   }
   if (changed) {
     let newJSON = JSON.stringify(packageJSON, null, '  ');
Repository: nodejs/node
Pull request: doc: update announce documentation for releases

This updates the announce section to match the current process of announcing releases on Node.js. This also mentions the latest Bluesky automation.

cc: @nodejs/releasers @nodejs/social 

Changed files:
filename: doc/contributing/releases.md
patch: @@ -1090,20 +1090,18 @@ This script will use the promoted builds and changelog to generate the post. Run
 ### 19. Announce
 
 The nodejs.org website will automatically rebuild and include the new version.
-To announce the build on Twitter through the official @nodejs account, email
-<pr@nodejs.org> with a message such as:
+To announce the build on social media, please ping the @nodejs-social-team
+on offical slack channel.
+
+Node.js is also available on Bluesky and a release announcement can be
+reposted using [nodejs/bluesky](https://github.com/nodejs/bluesky) repository.
+
+The post content can be as simple as:
 
 > v5.8.0 of @nodejs is out: <https://nodejs.org/en/blog/release/v5.8.0/>
 > …
 > something here about notable changes
 
-To ensure communication goes out with the timing of the blog post, please allow
-24 hour prior notice. If known, please include the date and time the release
-will be shared with the community in the email to coordinate these
-announcements.
-
-Ping the IRC ops and the other [Partner Communities][] liaisons.
-
 <details>
 <summary>Security release</summary>
 
@@ -1437,7 +1435,6 @@ Typical resolution: sign the release again.
 [Build issue tracker]: https://github.com/nodejs/build/issues/new
 [CI lockdown procedure]: https://github.com/nodejs/build/blob/HEAD/doc/jenkins-guide.md#restricting-access-for-security-releases
 [Node.js Snap management repository]: https://github.com/nodejs/snap
-[Partner Communities]: https://github.com/nodejs/community-committee/blob/HEAD/governance/PARTNER_COMMUNITIES.md
 [Snap]: https://snapcraft.io/node
 [`create-release-proposal`]: https://github.com/nodejs/node/actions/workflows/create-release-proposal.yml
 [build-infra team]: https://github.com/orgs/nodejs/teams/build-infra
Repository: denoland/deno
Pull request: fix(add): Support dist tags in deno add

Fixes #24956.

Changed files:
filename: cli/npm/mod.rs
patch: @@ -124,6 +124,10 @@ impl NpmFetchResolver {
     let maybe_get_nv = || async {
       let name = req.name.clone();
       let package_info = self.package_info(&name).await?;
+      if let Some(dist_tag) = req.version_req.tag() {
+        let version = package_info.dist_tags.get(dist_tag)?.clone();
+        return Some(PackageNv { name, version });
+      }
       // Find the first matching version of the package.
       let mut versions = package_info.versions.keys().collect::<Vec<_>>();
       versions.sort();

filename: tests/specs/add/dist_tag/__test__.jsonc
patch: @@ -0,0 +1,9 @@
+{
+  "tempDir": true,
+  "steps": [
+    {
+      "args": "add npm:ajv@latest",
+      "output": "Add npm:ajv@8.11.0\n"
+    }
+  ]
+}

filename: tests/specs/install/future_install_add_dist_tag/__test__.jsonc
patch: @@ -0,0 +1,12 @@
+{
+  "tempDir": true,
+  "steps": [
+    {
+      "envs": {
+        "DENO_FUTURE": "1"
+      },
+      "args": "install npm:ajv@latest",
+      "output": "install.out"
+    }
+  ]
+}

filename: tests/specs/install/future_install_add_dist_tag/install.out
patch: @@ -0,0 +1,15 @@
+Add npm:ajv@8.11.0
+[UNORDERED_START]
+Download http://localhost:4260/ajv
+Download http://localhost:4260/fast-deep-equal
+Download http://localhost:4260/json-schema-traverse
+Download http://localhost:4260/require-from-string
+Download http://localhost:4260/uri-js
+Download http://localhost:4260/punycode
+Download http://localhost:4260/ajv/ajv-8.11.0.tgz
+Download http://localhost:4260/fast-deep-equal/fast-deep-equal-3.1.3.tgz
+Download http://localhost:4260/uri-js/uri-js-4.4.1.tgz
+Download http://localhost:4260/json-schema-traverse/json-schema-traverse-1.0.0.tgz
+Download http://localhost:4260/require-from-string/require-from-string-2.0.2.tgz
+Download http://localhost:4260/punycode/punycode-2.1.1.tgz
+[UNORDERED_END]
Repository: facebook/react
Pull request: [tmp] Enable enableCache on Test Renderer native

<!--
  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 debug-test --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?
-->

## How did you test this change?

<!--
  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/shared/forks/ReactFeatureFlags.test-renderer.native.js
patch: @@ -23,7 +23,7 @@ export const enableUpdaterTracking = false;
 export const enableSuspenseServerRenderer = false;
 export const enableSelectiveHydration = false;
 export const enableLazyElements = false;
-export const enableCache = false;
+export const enableCache = true;
 export const disableJavaScriptURLs = false;
 export const disableCommentsAsDOMContainers = true;
 export const disableInputAttributeSyncing = false;
Repository: huggingface/transformers
Pull request: enable 5 cases on XPU

**command**
`pytest -rA tests/models/speecht5/test_modeling_speecht5.py::SpeechT5ForTextToSpeechIntegrationTests::test_batch_generation`

`pytest -rA  tests/models/glm/test_modeling_glm.py::GlmIntegrationTest::test_model_9b_bf16`
`pytest -rA tests/models/glm/test_modeling_glm.py::GlmIntegrationTest::test_model_9b_eager`
`pytest -rA tests/models/glm/test_modeling_glm.py::GlmIntegrationTest::test_model_9b_fp16`
`pytest -rA tests/models/glm/test_modeling_glm.py::GlmIntegrationTest::test_model_9b_sdpa`

**results**

all pass on XPU


Changed files:
filename: src/transformers/testing_utils.py
patch: @@ -1026,6 +1026,19 @@ def require_torch_large_gpu(test_case, memory: float = 20):
     )(test_case)
 
 
+def require_torch_large_accelerator(test_case, memory: float = 20):
+    """Decorator marking a test that requires an accelerator with more than `memory` GiB of memory."""
+    if torch_device != "cuda" and torch_device != "xpu":
+        return unittest.skip(reason=f"test requires a GPU or XPU with more than {memory} GiB of memory")(test_case)
+
+    torch_accelerator_module = getattr(torch, torch_device)
+
+    return unittest.skipUnless(
+        torch_accelerator_module.get_device_properties(0).total_memory / 1024**3 > memory,
+        f"test requires a GPU or XPU with more than {memory} GiB of memory",
+    )(test_case)
+
+
 def require_torch_gpu_if_bnb_not_multi_backend_enabled(test_case):
     """
     Decorator marking a test that requires a GPU if bitsandbytes multi-backend feature is not enabled.

filename: tests/models/glm/test_modeling_glm.py
patch: @@ -22,7 +22,7 @@
     is_flaky,
     require_flash_attn,
     require_torch,
-    require_torch_large_gpu,
+    require_torch_large_accelerator,
     require_torch_sdpa,
     slow,
     torch_device,
@@ -309,7 +309,7 @@ def test_custom_4d_attention_mask(self):
 
 
 @slow
-@require_torch_large_gpu
+@require_torch_large_accelerator
 class GlmIntegrationTest(unittest.TestCase):
     input_text = ["Hello I am doing", "Hi today"]
     model_id = "THUDM/glm-4-9b"

filename: tests/models/speecht5/test_modeling_speecht5.py
patch: @@ -1223,6 +1223,7 @@ def test_one_to_many_generation(self):
                 "Mismatch in waveform between standalone and integrated vocoder for single instance generation.",
             )
 
+    @require_deterministic_for_xpu
     def test_batch_generation(self):
         model = self.default_model
         processor = self.default_processor