[PR #1627] fix(labs): use ESP32 SRAM capacity and correct OOM badge in lab 03 #9233

Open
opened 2026-05-03 01:29:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1627
Author: @Shashank-Tripathi-07
Created: 5/3/2026
Status: 🔄 Open

Base: devHead: fix/lab03-esp32-sram-field


📝 Commits (1)

  • d4f0c3a fix(labs): use ESP32 SRAM capacity and correct OOM badge in lab 03

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 labs/vol1/lab_03_ml_workflow.py (+2 -2)

📄 Description

Summary

  • Hardware.Tiny.ESP32_S3.memory.capacity returns 8 MB flash storage (7812 KiB), not SRAM
  • The correct field for the 512 KiB SRAM is memory.sram_capacity
  • Lab 03 line 39 was reading flash instead of SRAM, making ESP32_RAM_KB = 7812 instead of 512
  • This caused the dynamic OOM ratio on line 348 (~{size}x over) to render as ~6x instead of the correct ~98x
  • The hardcoded badge 200x OOM Discovered at Stage 5 is updated to ~100x OOM Discovered at Stage 5 to match

Same root cause as PR #1625 (lab 01) and PR #1626 (lab 02).

Changes

# Before (wrong -- reads 8 MB flash storage)
ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.capacity.m_as("KiB")

# After (correct -- reads 512 KiB SRAM)
ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB")

Badge: 200x OOM Discovered at Stage 5 -> ~100x OOM Discovered at Stage 5

Test plan

  • Verify Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB") returns 512
  • Run lab 03 and confirm the Engine.solve() block shows ~98x over
  • Confirm badge reads ~100x OOM

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1627 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 5/3/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/lab03-esp32-sram-field` --- ### 📝 Commits (1) - [`d4f0c3a`](https://github.com/harvard-edge/cs249r_book/commit/d4f0c3a80e3ba79d616a899f2f03e7664baef457) fix(labs): use ESP32 SRAM capacity and correct OOM badge in lab 03 ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `labs/vol1/lab_03_ml_workflow.py` (+2 -2) </details> ### 📄 Description ## Summary - `Hardware.Tiny.ESP32_S3.memory.capacity` returns 8 MB **flash storage** (7812 KiB), not SRAM - The correct field for the 512 KiB SRAM is `memory.sram_capacity` - Lab 03 line 39 was reading flash instead of SRAM, making `ESP32_RAM_KB = 7812` instead of `512` - This caused the dynamic OOM ratio on line 348 (`~{size}x over`) to render as `~6x` instead of the correct `~98x` - The hardcoded badge `200x OOM Discovered at Stage 5` is updated to `~100x OOM Discovered at Stage 5` to match Same root cause as PR #1625 (lab 01) and PR #1626 (lab 02). ## Changes ```python # Before (wrong -- reads 8 MB flash storage) ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.capacity.m_as("KiB") # After (correct -- reads 512 KiB SRAM) ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB") ``` Badge: `200x OOM Discovered at Stage 5` -> `~100x OOM Discovered at Stage 5` ## Test plan - [ ] Verify `Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB")` returns 512 - [ ] Run lab 03 and confirm the Engine.solve() block shows `~98x over` - [ ] Confirm badge reads `~100x OOM` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 01:29:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#9233