helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: page scaling in silent mode printing

Backport of #45218

See that PR for details.


Notes: Fixed an issue where print scaling could be too small during silent print. 


Changed files:
filename: patches/chromium/printing.patch
patch: @@ -653,7 +653,7 @@ index 6809c4576c71bc1e1a6ad4e0a37707272a9a10f4..3aad10424a6a31dab2ca393d00149ec6
    PrintingFailed(int32 cookie, PrintFailureReason reason);
  
 diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
-index 18a8d64167b66d0de67c0c89779af90814b827c6..33079deee8720a447e2b4e1f3601542b59e1cf16 100644
+index 18a8d64167b66d0de67c0c89779af90814b827c6..52b95469f0392fbb108bef3f6d5ea0f8a81410fd 100644
 --- a/components/printing/renderer/print_render_frame_helper.cc
 +++ b/components/printing/renderer/print_render_frame_helper.cc
 @@ -52,6 +52,7 @@
@@ -771,7 +771,7 @@ index 18a8d64167b66d0de67c0c89779af90814b827c6..33079deee8720a447e2b4e1f3601542b
      // Check if `this` is still valid.
      if (!self)
        return;
-@@ -2359,29 +2374,37 @@ void PrintRenderFrameHelper::IPCProcessed() {
+@@ -2359,29 +2374,43 @@ void PrintRenderFrameHelper::IPCProcessed() {
  }
  
  bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame,
@@ -803,10 +803,18 @@ index 18a8d64167b66d0de67c0c89779af90814b827c6..33079deee8720a447e2b4e1f3601542b
  
    bool center_on_paper = !IsPrintingPdfFrame(frame, node);
 -  settings.params->print_scaling_option =
-+  settings->params->print_scaling_option =
-       center_on_paper ? mojom::PrintScalingOption::kCenterShrinkToFitPaper
-                       : mojom::PrintScalingOption::kSourceSize;
+-      center_on_paper ? mojom::PrintScalingOption::kCenterShrinkToFitPaper
+-                      : mojom::PrintScalingOption::kSourceSize;
 -  RecordDebugEvent(settings.params->printed_doc_type ==
++  bool silent = new_settings.FindBool("silent").value_or(false);
++  if (silent) {
++    settings->params->print_scaling_option = mojom::PrintScalingOption::kFitToPrintableArea;
++  } else {
++    settings->params->print_scaling_option =
++        center_on_paper ? mojom::PrintScalingOption::kCenterShrinkToFitPaper
++                        : mojom::PrintScalingOption::kSourceSize;
++  }
++
 +  RecordDebugEvent(settings->params->printed_doc_type ==
                             mojom::SkiaDocumentType::kMSKP
                         ? DebugEvent::kSetPrintSettings5
Repository: facebook/react
Pull request: fix[devtools/profilingCache-test]: specify correct version gate for test

- Correctly gate the test to `[18.0.0, 18.2.0]` versions of react, as it was initially defined before https://github.com/facebook/react/pull/26742
- I have recently fixed the gating logic in https://github.com/facebook/react/pull/26955 and https://github.com/facebook/react/pull/26997, should be stable now
- I have added a non-gated version of this test, which should run only for the current version of react, the one we build from sources
- The test version for react `v[18.0.0, 18.2.0]` should expect `"priorityLevel": "Immediate"`, the other `"priorityLevel": "Normal"`, as it was changed in https://github.com/facebook/react/pull/26512

Changed files:
filename: packages/react-devtools-shared/src/__tests__/profilingCache-test.js
patch: @@ -938,11 +938,51 @@ describe('ProfilingCache', () => {
     }
   });
 
-  // @reactVersion >= 17
-  // @reactVersion < 18
+  // @reactVersion >= 18.0.0
+  // @reactVersion <= 18.2.0
+  it('should handle unexpectedly shallow suspense trees for react v[18.0.0 - 18.2.0]', () => {
+    const container = document.createElement('div');
+
+    utils.act(() => store.profilerStore.startProfiling());
+    utils.act(() => legacyRender(<React.Suspense />, container));
+    utils.act(() => store.profilerStore.stopProfiling());
+
+    const rootID = store.roots[0];
+    const commitData = store.profilerStore.getDataForRoot(rootID).commitData;
+    expect(commitData).toMatchInlineSnapshot(`
+      [
+        {
+          "changeDescriptions": Map {},
+          "duration": 0,
+          "effectDuration": null,
+          "fiberActualDurations": Map {
+            1 => 0,
+            2 => 0,
+          },
+          "fiberSelfDurations": Map {
+            1 => 0,
+            2 => 0,
+          },
+          "passiveEffectDuration": null,
+          "priorityLevel": "Immediate",
+          "timestamp": 0,
+          "updaters": [
+            {
+              "displayName": "render()",
+              "hocDisplayNames": null,
+              "id": 1,
+              "key": null,
+              "type": 11,
+            },
+          ],
+        },
+      ]
+    `);
+  });
+
+  // This test is not gated.
+  // For this test we use the current version of react, built from source.
   it('should handle unexpectedly shallow suspense trees', () => {
-    // This test only runs in v17 because it's a regression test for legacy
-    // Suspense behavior, and the implementation details changed in v18.
     const container = document.createElement('div');
 
     utils.act(() => store.profilerStore.startProfiling());
Repository: huggingface/transformers
Pull request: fix `Gemma3nProcessorTest`

# What does this PR do?

Use  [a new repository](https://huggingface.co/hf-internal-testing/namespace-google-repo_name-gemma-3n-E4B-it/tree/main) to run processor tests on CircleCI.

or if @RyanMullins could check these maybe?

There are still 2 failures, could you take a look on these 2 please?

> FAILED tests/models/gemma3n/test_processing_gemma3n.py::Gemma3nProcessorTest::test_save_load_pretrained_additional_features - AssertionError: '{\n [107 chars]  "disable_grouping": null,\n  "dither": 5.0,\[1044 chars]n}\n' != '{\n [107 chars]  "dither": 5.0,\n  "do_center_crop": null,\n [1015 chars]n}\n'

> FAILED tests/models/gemma3n/test_processing_gemma3n.py::Gemma3nProcessorTest::test_save_load_pretrained_default - AssertionError: '{\n [107 chars]  "disable_grouping": null,\n  "dither": 0.0,\[1044 chars]n}\n' != '{\n [107 chars]  "dither": 0.0,\n  "do_center_crop": null,\n [1015 chars]n}\n'


Changed files:
filename: tests/models/gemma3n/test_processing_gemma3n.py
patch: @@ -36,7 +36,7 @@
 class Gemma3nProcessorTest(unittest.TestCase):
     def setUp(self):
         # TODO: update to google?
-        self.model_id = "Google/gemma-3n-E4B-it"
+        self.model_id = "hf-internal-testing/namespace-google-repo_name-gemma-3n-E4B-it"
         self.tmpdirname = tempfile.mkdtemp(suffix="gemma3n")
         self.maxDiff = None
 
@@ -71,6 +71,9 @@ def test_save_load_pretrained_default(self):
         self.assertIsInstance(processor.tokenizer, GemmaTokenizerFast)
         self.assertEqual(processor.tokenizer.get_vocab(), tokenizer.get_vocab())
 
+        # `disable_grouping` is a new attribute that got added on main while gemma3n was being released - so was
+        # not part of the saved processor
+        del processor.feature_extractor.disable_grouping
         self.assertIsInstance(processor.feature_extractor, Gemma3nAudioFeatureExtractor)
         self.assertEqual(processor.feature_extractor.to_json_string(), feature_extractor.to_json_string())
 
@@ -94,6 +97,9 @@ def test_save_load_pretrained_additional_features(self):
         self.assertEqual(processor.tokenizer.get_vocab(), tokenizer_add_kwargs.get_vocab())
         self.assertIsInstance(processor.tokenizer, GemmaTokenizerFast)
 
+        # `disable_grouping` is a new attribute that got added on main while gemma3n was being released - so was
+        # not part of the saved processor
+        del processor.feature_extractor.disable_grouping
         self.assertEqual(processor.feature_extractor.to_json_string(), feature_extractor_add_kwargs.to_json_string())
         self.assertIsInstance(processor.feature_extractor, Gemma3nAudioFeatureExtractor)
Repository: electron/electron
Pull request: fix: broken OOP `window.print()` on macOS/Linux

Backport of #45214

See that PR for details.


Notes: Fixed broken OOP `window.print()` on macOS/Linux.


Changed files:
filename: shell/utility/electron_content_utility_client.cc
patch: @@ -31,6 +31,11 @@
 #include "components/services/print_compositor/public/mojom/print_compositor.mojom.h"  // nogncheck
 #endif  // BUILDFLAG(ENABLE_PRINTING)
 
+#if BUILDFLAG(ENABLE_OOP_PRINTING)
+#include "chrome/services/printing/print_backend_service_impl.h"
+#include "chrome/services/printing/public/mojom/print_backend_service.mojom.h"
+#endif  // BUILDFLAG(ENABLE_OOP_PRINTING)
+
 #if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(IS_WIN)
 #include "chrome/services/printing/pdf_to_emf_converter_factory.h"
 #endif
@@ -72,6 +77,21 @@ auto RunPrintCompositor(
 }
 #endif
 
+#if BUILDFLAG(ENABLE_OOP_PRINTING)
+auto RunPrintingSandboxedPrintBackendHost(
+    mojo::PendingReceiver<printing::mojom::SandboxedPrintBackendHost>
+        receiver) {
+  return std::make_unique<printing::SandboxedPrintBackendHostImpl>(
+      std::move(receiver));
+}
+auto RunPrintingUnsandboxedPrintBackendHost(
+    mojo::PendingReceiver<printing::mojom::UnsandboxedPrintBackendHost>
+        receiver) {
+  return std::make_unique<printing::UnsandboxedPrintBackendHostImpl>(
+      std::move(receiver));
+}
+#endif  // BUILDFLAG(ENABLE_OOP_PRINTING)
+
 auto RunProxyResolver(
     mojo::PendingReceiver<proxy_resolver::mojom::ProxyResolverFactory>
         receiver) {
@@ -122,6 +142,11 @@ void ElectronContentUtilityClient::RegisterMainThreadServices(
   services.Add(RunPrintCompositor);
 #endif
 
+#if BUILDFLAG(ENABLE_OOP_PRINTING)
+  services.Add(RunPrintingSandboxedPrintBackendHost);
+  services.Add(RunPrintingUnsandboxedPrintBackendHost);
+#endif
+
 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \
     (BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(IS_WIN))
   services.Add(RunPrintingService);
Repository: facebook/react
Pull request: fix[devtools/ci]: fixed incorrect condition calculation for @reactVersion annotation

Suppose that you have this setup for devtools test:
```
// @reactVersion <= 18.1
// @reactVersion >= 17.1
```

With previous implementation, the accumulated condition will be `"<= 18.1" && ">= 17.1"`, which is just `">= 17.1"`, when evaluated. That's why we executed some tests for old versions of react on main (and failed). 

With these changes the resulting condition will be `"<= 18.1 >= 17.1"`, not using `&&`, because semver does not support this operator. All currently failing tests will be skipped now as expected.

Also increased timeout value for shell server to start

Changed files:
filename: packages/react-devtools-extensions/src/__tests__/xGoogleIgnoreList-test.js
patch: @@ -13,7 +13,7 @@ import path from 'path';
 import {rimrafSync} from 'rimraf';
 
 describe('x_google_ignoreList source map extension', () => {
-  jest.setTimeout(30 * 1000);
+  jest.setTimeout(60 * 1000);
 
   const pathToExtensionsPackage = path.resolve(__dirname, '..', '..');
   const pathToChromeExtensionBuild = path.join(

filename: scripts/babel/transform-react-version-pragma.js
patch: @@ -26,31 +26,29 @@ function transform(babel) {
       return null;
     }
 
-    let conditions = null;
-    for (const line of comments) {
-      const commentStr = line.value.trim();
-      if (commentStr.startsWith(GATE_VERSION_STR)) {
-        const condition = t.stringLiteral(
-          commentStr.slice(GATE_VERSION_STR.length)
-        );
-        if (conditions === null) {
-          conditions = [condition];
-        } else {
-          conditions.push(condition);
+    const resultingCondition = comments.reduce(
+      (accumulatedCondition, commentLine) => {
+        const commentStr = commentLine.value.trim();
+
+        if (!commentStr.startsWith(GATE_VERSION_STR)) {
+          return accumulatedCondition;
+        }
+
+        const condition = commentStr.slice(GATE_VERSION_STR.length);
+        if (accumulatedCondition === null) {
+          return condition;
         }
-      }
-    }
 
-    if (conditions !== null) {
-      let condition = conditions[0];
-      for (let i = 1; i < conditions.length; i++) {
-        const right = conditions[i];
-        condition = t.logicalExpression('&&', condition, right);
-      }
-      return condition;
-    } else {
+        return accumulatedCondition.concat(' ', condition);
+      },
+      null
+    );
+
+    if (resultingCondition === null) {
       return null;
     }
+
+    return t.stringLiteral(resultingCondition);
   }
 
   return {

filename: scripts/circleci/run_devtools_e2e_tests.js
patch: @@ -76,7 +76,7 @@ function runTestShell() {
     // Assume the test shell server failed to start.
     logError('Testing shell server failed to start');
     exitWithCode(1);
-  }, 30000);
+  }, 60 * 1000);
 
   logBright('Starting testing shell server');
Repository: nodejs/node
Pull request: inspect: fix console.log(%s, { [Symbol.toPrimitive]: () => hello })

`console.log("%s", o)` invokes the `inspect `method to retrieve the object. This results in `console.log("%s", { [Symbol.toPrimitive]: () => "hello" })` displaying the object itself, rather than 'hello'.

Fixes: #50909

Changed files:
filename: lib/internal/util/inspect.js
patch: @@ -87,6 +87,7 @@ const {
   SymbolIterator,
   SymbolPrototypeToString,
   SymbolPrototypeValueOf,
+  SymbolToPrimitive,
   SymbolToStringTag,
   TypedArrayPrototypeGetLength,
   TypedArrayPrototypeGetSymbolToStringTag,
@@ -2103,6 +2104,11 @@ function hasBuiltInToString(value) {
     value = proxyTarget;
   }
 
+  // Check if value has a custom Symbol.toPrimitive transformation.
+  if (typeof value[SymbolToPrimitive] === 'function') {
+    return false;
+  }
+
   // Count objects that have no `toString` function as built-in.
   if (typeof value.toString !== 'function') {
     return true;

filename: test/parallel/test-util-format.js
patch: @@ -269,6 +269,27 @@ assert.strictEqual(util.format('%s', -Infinity), '-Infinity');
   );
 }
 
+// Symbol.toPrimitive handling for string format specifier
+{
+  const objectWithToPrimitive = {
+    [Symbol.toPrimitive](hint) {
+      switch (hint) {
+        case 'number':
+          return 42;
+        case 'string':
+          return 'string representation';
+        case 'default':
+        default:
+          return 'default context';
+      }
+    }
+  };
+
+  assert.strictEqual(util.format('%s', +objectWithToPrimitive), '42');
+  assert.strictEqual(util.format('%s', objectWithToPrimitive), 'string representation');
+  assert.strictEqual(util.format('%s', objectWithToPrimitive + ''), 'default context');
+}
+
 // JSON format specifier
 assert.strictEqual(util.format('%j'), '%j');
 assert.strictEqual(util.format('%j', 42), '42');
Repository: facebook/react
Pull request: Fix disableStrictPassiveEffect not working under Suspense

In https://github.com/facebook/react/pull/26914 I added an extra logic to turn off effect if `disableStrictPassiveEffect` is an `Offscreen` tag. But `Suspense` uses `Offscreen` tag internally and that turns off `disableStrictPassiveEffect` for everything. 

Changed files:
filename: packages/react-reconciler/src/ReactFiber.js
patch: @@ -760,10 +760,6 @@ export function createFiberFromOffscreen(
   lanes: Lanes,
   key: null | string,
 ): Fiber {
-  if (__DEV__) {
-    // StrictMode in Offscreen should always run double passive effects
-    mode &= ~NoStrictPassiveEffectsMode;
-  }
   const fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
   fiber.elementType = REACT_OFFSCREEN_TYPE;
   fiber.lanes = lanes;

filename: packages/react-reconciler/src/__tests__/ReactOffscreenStrictMode-test.js
patch: @@ -55,8 +55,8 @@ describe('ReactOffscreenStrictMode', () => {
     ]);
   });
 
-  // @gate __DEV__ && enableOffscreen
-  it('should trigger strict effects when disableStrictPassiveEffect is presented on StrictMode', async () => {
+  // @gate __DEV__ && enableOffscreen && enableDO_NOT_USE_disableStrictPassiveEffect
+  it('does not trigger strict effects when disableStrictPassiveEffect is presented on StrictMode', async () => {
     await act(() => {
       ReactNoop.render(
         <React.StrictMode DO_NOT_USE_disableStrictPassiveEffect={true}>
@@ -73,9 +73,7 @@ describe('ReactOffscreenStrictMode', () => {
       'A: useLayoutEffect mount',
       'A: useEffect mount',
       'A: useLayoutEffect unmount',
-      'A: useEffect unmount',
       'A: useLayoutEffect mount',
-      'A: useEffect mount',
     ]);
   });
 

filename: packages/react/src/__tests__/ReactStrictMode-test.internal.js
patch: @@ -126,6 +126,30 @@ describe('ReactStrictMode', () => {
         ]);
       });
 
+      // @gate enableDO_NOT_USE_disableStrictPassiveEffect
+      it('should include legacy + strict effects mode, but not strict passive effect with disableStrictPassiveEffect in Suspense', async () => {
+        await act(() => {
+          const container = document.createElement('div');
+          const root = ReactDOMClient.createRoot(container);
+          root.render(
+            <React.StrictMode DO_NOT_USE_disableStrictPassiveEffect={true}>
+              <React.Suspense>
+                <Component label="A" />
+              </React.Suspense>
+            </React.StrictMode>,
+          );
+        });
+
+        expect(log).toEqual([
+          'A: render',
+          'A: render',
+          'A: useLayoutEffect mount',
+          'A: useEffect mount',
+          'A: useLayoutEffect unmount',
+          'A: useLayoutEffect mount',
+        ]);
+      });
+
       it('should allow level to be increased with nesting', async () => {
         await act(() => {
           const container = document.createElement('div');
Repository: huggingface/transformers
Pull request: [Whisper] fix shape mismatch in tests

# What does this PR do?

The switch to `torch.testing.assert_close` entailed shape mismatches, forgot to update 😅


Changed files:
filename: tests/models/whisper/test_modeling_whisper.py
patch: @@ -2040,7 +2040,7 @@ def test_large_timestamp_generation(self):
             [50365, 2221, 13, 2326, 388, 391, 307, 264, 50244, 295, 264, 2808, 5359, 11, 293, 321, 366, 5404, 281, 2928, 702, 14943, 13, 50629, 50682, 6966, 307, 2221, 13, 2326, 388, 391, 311, 9060, 1570, 1880, 813, 702, 1871, 13, 50870, 50911, 634, 5112, 505, 300, 412, 341, 42729, 3196, 295, 264, 1064, 11, 365, 5272, 293, 12904, 9256, 450, 10539, 949, 505, 11, 51245, 51287, 1034, 4680, 10117, 490, 3936, 293, 1080, 3542, 5160, 881, 26336, 281, 264, 1575, 13, 51494, 51523, 634, 575, 12525, 22618, 1968, 6144, 35617, 1456, 397, 266, 311, 589, 307, 534, 10281, 934, 439, 11, 51799, 51815, 50365, 293, 393, 4411, 50431]
         ])
         # fmt: on
-        torch.testing.assert_close(generated_ids[0], EXPECTED_OUTPUT)
+        torch.testing.assert_close(generated_ids, EXPECTED_OUTPUT)
 
         EXPECTED_TRANSCRIPT = [
             {
Repository: vercel/next.js
Pull request: Turbopack: list `assert/strict` as external

Closes PACK-4891

Changed files:
filename: turbopack/crates/turbopack-resolve/src/resolve.rs
patch: @@ -15,8 +15,9 @@ use crate::{
     typescript::{apply_tsconfig_resolve_options, tsconfig, tsconfig_resolve_options},
 };
 
-const NODE_EXTERNALS: [&str; 63] = [
+const NODE_EXTERNALS: [&str; 64] = [
     "assert",
+    "assert/strict",
     "async_hooks",
     "buffer",
     "child_process",
Repository: denoland/deno
Pull request: fix(fmt): support "--ext vto" and "--ext njk"

I can use this to rework formatting in the extension so they don't have to go through the LSP.

Towards https://github.com/denoland/vscode_deno/issues/1228.

Changed files:
filename: cli/args/flags.rs
patch: @@ -2281,7 +2281,7 @@ Ignore formatting a file by adding an ignore comment at the top of the file:
           .value_parser([
             "ts", "tsx", "js", "jsx", "md", "json", "jsonc", "css", "scss",
             "sass", "less", "html", "svelte", "vue", "astro", "yml", "yaml",
-            "ipynb", "sql"
+            "ipynb", "sql", "vto", "njk"
           ])
           .help_heading(FMT_HEADING).requires("files"),
       )

filename: tests/specs/fmt/njk/__test__.jsonc
patch: @@ -1,5 +1,14 @@
 {
   "tempDir": true,
-  "args": "fmt --unstable-component",
-  "output": "[WILDLINE]badly_formatted.njk\nChecked 1 file\n"
-}
\ No newline at end of file
+  "steps": [
+    {
+      "args": "fmt --unstable-component",
+      "output": "[WILDLINE]badly_formatted.njk\nChecked 1 file\n"
+    },
+    {
+      "args": "fmt --unstable-component --ext=njk -",
+      "input": "<h1>  {{ \"Hello, world!\" |> toUpperCase }}\n  </h1>\n",
+      "output": "<h1>\n  {{ \"Hello, world!\" |> toUpperCase }}\n</h1>\n"
+    }
+  ]
+}

filename: tests/specs/fmt/vento/__test__.jsonc
patch: @@ -1,5 +1,14 @@
 {
   "tempDir": true,
-  "args": "fmt --unstable-component",
-  "output": "[WILDLINE]badly_formatted.vto\nChecked 1 file\n"
-}
\ No newline at end of file
+  "steps": [
+    {
+      "args": "fmt --unstable-component",
+      "output": "[WILDLINE]badly_formatted.vto\nChecked 1 file\n"
+    },
+    {
+      "args": "fmt --unstable-component --ext=vto -",
+      "input": "<h1>  {{ \"Hello, world!\" |> upper }}\n  </h1>\n",
+      "output": "<h1>\n  {{ \"Hello, world!\" |> upper }}\n</h1>\n"
+    }
+  ]
+}
Repository: ggml-org/llama.cpp
Pull request: server : filter out harmony thought messages

Remove harmony analysis from messages when "exclude thoughts" option is enabled.

Putting this in another PR if it's wanted on master sooner. Feel free to close if not.

ref: https://github.com/ggml-org/llama.cpp/pull/15181#issuecomment-3179233125

cc @ggerganov @ngxson

Changed files:
filename: tools/server/webui/src/utils/misc.ts
patch: @@ -130,7 +130,12 @@ export function filterThoughtFromMsgs(messages: APIMessage[]) {
       role: msg.role,
       content:
         msg.role === 'assistant'
-          ? contentStr.split('</think>').at(-1)!.trim()
+          ? contentStr
+              .split(
+                /<\/think>|<\|start\|>assistant<\|channel\|>final<\|message\|>/
+              )
+              .at(-1)!
+              .trim()
           : contentStr,
     } as APIMessage;
   });